You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

28 lines
1.1 MiB

/**
* plotly.js (cartesian - minified) v1.58.4
* Copyright 2012-2020, Plotly, Inc.
* All rights reserved.
* Licensed under the MIT license
*/
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}((function(){return function t(e,r,n){function a(o,l){if(!r[o]){if(!e[o]){var s="function"==typeof require&&require;if(!l&&s)return s(o,!0);if(i)return i(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[o]={exports:{}};e[o][0].call(u.exports,(function(t){return a(e[o][1][t]||t)}),u,u.exports,t,e,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o<n.length;o++)a(n[o]);return a}({1:[function(t,e,r){"use strict";var n=t("../src/lib"),a={"X,X div":"direction:ltr;font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;","X input,X button":"font-family:'Open Sans', verdana, arial, sans-serif;","X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color 0.3s ease 0s;-moz-transition:background-color 0.3s ease 0s;-ms-transition:background-color 0.3s ease 0s;-o-transition:background-color 0.3s ease 0s;transition:background-color 0.3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;","X [data-title]:after":"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:white;","X .select-outline-2":"stroke:black;stroke-dasharray:2px 2px;",Y:"font-family:'Open Sans', 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":233}],2:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":344}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/box")},{"../src/traces/box":359}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/contour")},{"../src/traces/contour":379}],5:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":214}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmap")},{"../src/traces/heatmap":395}],7:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram")},{"../src/traces/histogram":413}],8:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2d")},{"../src/traces/histogram2d":419}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":423}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/image")},{"../src/traces/image":431}],11:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./bar"),t("./box"),t("./heatmap"),t("./histogram"),t("./histogram2d"),t("./histogram2dcontour"),t("./image"),t("./pie"),t("./contour"),t("./scatterternary"),t("./violin")]),e.exports=n},{"./bar":2,"./box":3,"./contour":4,"./core":5,"./heatmap":6,"./histogram":7,"./histogram2d":8,"./histogram2dcontour":9,"./image":10,"./pie":12,"./scatterternary":13,"./violin":14}],12:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":440}],13:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterternary")},{"../src/traces/scatterternary":481}],14:[function(t,e,r){"use strict";e.exports=t("../src/traces/violin")},{"../src/traces/violin":489}],15:[function(t,e,r){"use strict";r.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},r.toByteArray=function(t){var e,r,n=c(t),o=n[0],l=n[1],s=new i(function(t,e,r){return 3*(e+r)/4-r}(0,o,l)),u=0,f=l>0?o-4:o;for(r=0;r<f;r+=4)e=a[t.charCodeAt(r)]<<18|a[t.charCodeAt(r+1)]<<12|a[t.charCodeAt(r+2)]<<6|a[t.charCodeAt(r+3)],s[u++]=e>>16&255,s[u++]=e>>8&255,s[u++]=255&e;2===l&&(e=a[t.charCodeAt(r)]<<2|a[t.charCodeAt(r+1)]>>4,s[u++]=255&e);1===l&&(e=a[t.charCodeAt(r)]<<10|a[t.charCodeAt(r+1)]<<4|a[t.charCodeAt(r+2)]>>2,s[u++]=e>>8&255,s[u++]=255&e);return s},r.fromByteArray=function(t){for(var e,r=t.length,a=r%3,i=[],o=0,l=r-a;o<l;o+=16383)i.push(u(t,o,o+16383>l?l:o+16383));1===a?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===a&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,s=o.length;l<s;++l)n[l]=o[l],a[o.charCodeAt(l)]=l;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,r){for(var a,i,o=[],l=e;l<r;l+=3)a=(t[l]<<16&16711680)+(t[l+1]<<8&65280)+(255&t[l+2]),o.push(n[(i=a)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],16:[function(t,e,r){},{}],17:[function(t,e,r){"use strict";var n,a="object"==typeof Reflect?Reflect:null,i=a&&"function"==typeof a.apply?a.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=a&&"function"==typeof a.ownKeys?a.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function l(){l.init.call(this)}e.exports=l,e.exports.once=function(t,e){return new Promise((function(r,n){function a(){void 0!==i&&t.removeListener("error",i),r([].slice.call(arguments))}var i;"error"!==e&&(i=function(r){t.removeListener(e,a),n(r)},t.once("error",i)),t.once(e,a)}))},l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var s=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?l.defaultMaxListeners:t._maxListeners}function f(t,e,r,n){var a,i,o,l;if(c(r),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),o=i[e]),void 0===o)o=i[e]=r,++t._eventsCount;else if("function"==typeof o?o=i[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(a=u(t))>0&&o.length>a&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=o.length,l=s,console&&console.warn&&console.warn(l)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},a=d.bind(n);return a.listener=r,n.wrapFn=a,a}function h(t,e,r){var n=t._events;if(void 0===n)return[];var a=n[e];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(a):v(a,a.length)}function g(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function v(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}Object.defineProperty(l,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),l.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},l.prototype.getMaxListeners=function(){return u(this)},l.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,a=this._events;if(void 0!==a)n=n&&void 0===a.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var s=a[t];if(void 0===s)return!1;if("function"==typeof s)i(s,this,e);else{var c=s.length,u=v(s,c);for(r=0;r<c;++r)i(u[r],this,e)}return!0},l.prototype.addListener=function(t,e){return f(this,t,e,!1)},l.prototype.on=l.prototype.addListener,l.prototype.prependListener=function(t,e){return f(this,t,e,!0)},l.prototype.once=function(t,e){return c(e),this.on(t,p(this,t,e)),this},l.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,p(this,t,e)),this},l.prototype.removeListener=function(t,e){var r,n,a,i,o;if(c(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(a=-1,i=r.length-1;i>=0;i--)if(r[i]===e||r[i].listener===e){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,a),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,o||e)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var a,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(a=i[n])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},l.prototype.listeners=function(t){return h(this,t,!0)},l.prototype.rawListeners=function(t){return h(this,t,!1)},l.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},l.prototype.listenerCount=g,l.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],18:[function(t,e,r){(function(e){(function(){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
"use strict";var e=t("base64-js"),n=t("ieee754");r.Buffer=i,r.SlowBuffer=function(t){+t!=t&&(t=0);return i.alloc(+t)},r.INSPECT_MAX_BYTES=50;function a(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return s(t)}return o(t,e,r)}function o(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|f(t,e),n=a(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(N(t,ArrayBuffer)||t&&N(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r);return n.__proto__=i.prototype,n}(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return i.from(n,e,r);var o=function(t){if(i.isBuffer(t)){var e=0|u(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||B(t.length)?a(0):c(t);if("Buffer"===t.type&&Array.isArray(t.data))return c(t.data)}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return i.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function s(t){return l(t),a(t<0?0:0|u(t))}function c(t){for(var e=t.length<0?0:0|u(t.length),r=a(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function u(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function f(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var a=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return I(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return R(t).length;default:if(a)return n?-1:I(t).length;e=(""+e).toLowerCase(),a=!0}}function d(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return A(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return M(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function h(t,e,r,n,a){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),B(r=+r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,a){var i,o=1,l=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,l/=2,s/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(a){var u=-1;for(i=r;i<l;i++)if(c(t,i)===c(e,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===s)return u*o}else-1!==u&&(i-=i-u),u=-1}else for(r+s>l&&(r=l-s),i=r;i>=0;i--){for(var f=!0,d=0;d<s;d++)if(c(t,i+d)!==c(e,d)){f=!1;break}if(f)return i}return-1}function v(t,e,r,n){r=Number(r)||0;var a=t.length-r;n?(n=Number(n))>a&&(n=a):n=a;var i=e.length;n>i/2&&(n=i/2);for(var o=0;o<n;++o){var l=parseInt(e.substr(2*o,2),16);if(B(l))return o;t[r+o]=l}return o}function m(t,e,r,n){return F(I(e,t.length-r),t,r,n)}function y(t,e,r,n){return F(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function x(t,e,r,n){return y(t,e,r,n)}function b(t,e,r,n){return F(R(e),t,r,n)}function _(t,e,r,n){return F(function(t,e){for(var r,n,a,i=[],o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,a=r%256,i.push(a),i.push(n);return i}(e,t.length-r),t,r,n)}function w(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function T(t,e,r){r=Math.min(t.length,r);for(var n=[],a=e;a<r;){var i,o,l,s,c=t[a],u=null,f=c>239?4:c>223?3:c>191?2:1;if(a+f<=r)switch(f){case 1:c<128&&(u=c);break;case 2:128==(192&(i=t[a+1]))&&(s=(31&c)<<6|63&i)>127&&(u=s);break;case 3:i=t[a+1],o=t[a+2],128==(192&i)&&128==(192&o)&&(s=(15&c)<<12|(63&i)<<6|63&o)>2047&&(s<55296||s>57343)&&(u=s);break;case 4:i=t[a+1],o=t[a+2],l=t[a+3],128==(192&i)&&128==(192&o)&&128==(192&l)&&(s=(15&c)<<18|(63&i)<<12|(63&o)<<6|63&l)>65535&&s<1114112&&(u=s)}null===u?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),a+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}r.kMaxLength=2147483647,i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,r){return o(t,e,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,r){return function(t,e,r){return l(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},i.allocUnsafe=function(t){return s(t)},i.allocUnsafeSlow=function(t){return s(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==i.prototype},i.compare=function(t,e){if(N(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),N(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,a=0,o=Math.min(r,n);a<o;++a)if(t[a]!==e[a]){r=t[a],n=e[a];break}return r<n?-1:n<r?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=i.allocUnsafe(e),a=0;for(r=0;r<t.length;++r){var o=t[r];if(N(o,Uint8Array)&&(o=i.from(o)),!i.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,a),a+=o.length}return n},i.byteLength=f,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)p(this,e,e+1);return this},i.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)p(this,e,e+3),p(this,e+1,e+2);return this},i.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)p(this,e,e+7),p(this,e+1,e+6),p(this,e+2,e+5),p(this,e+3,e+4);return this},i.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?T(this,0,t):d.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===i.compare(this,t)},i.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},i.prototype.compare=function(t,e,r,n,a){if(N(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(a>>>=0)-(n>>>=0),l=(r>>>=0)-(e>>>=0),s=Math.min(o,l),c=this.slice(n,a),u=t.slice(e,r),f=0;f<s;++f)if(c[f]!==u[f]){o=c[f],l=u[f];break}return o<l?-1:l<o?1:0},i.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},i.prototype.indexOf=function(t,e,r){return h(this,t,e,r,!0)},i.prototype.lastIndexOf=function(t,e,r){return h(this,t,e,r,!1)},i.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var a=this.length-e;if((void 0===r||r>a)&&(r=a),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;a<r;++a)n+=String.fromCharCode(127&t[a]);return n}function M(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;a<r;++a)n+=String.fromCharCode(t[a]);return n}function A(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var a="",i=e;i<r;++i)a+=E(t[i]);return a}function L(t,e,r){for(var n=t.slice(e,r),a="",i=0;i<n.length;i+=2)a+=String.fromCharCode(n[i]+256*n[i+1]);return a}function S(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function O(t,e,r,n,a,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,a,i){return e=+e,r>>>=0,i||O(t,0,r,4),n.write(t,e,r,a,23,4),r+4}function z(t,e,r,a,i){return e=+e,r>>>=0,i||O(t,0,r,8),n.write(t,e,r,a,52,8),r+8}i.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=i.prototype,n},i.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t],a=1,i=0;++i<e&&(a*=256);)n+=this[t+i]*a;return n},i.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t+--e],a=1;e>0&&(a*=256);)n+=this[t+--e]*a;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t],a=1,i=0;++i<e&&(a*=256);)n+=this[t+i]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=e,a=1,i=this[t+--n];n>0&&(a*=256);)i+=this[t+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||S(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||S(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||S(t,4,this.length),n.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||S(t,4,this.length),n.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||S(t,8,this.length),n.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||S(t,8,this.length),n.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var a=1,i=0;for(this[e]=255&t;++i<r&&(a*=256);)this[e+i]=t/a&255;return e+r},i.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var a=r-1,i=1;for(this[e+a]=255&t;--a>=0&&(i*=256);)this[e+a]=t/i&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);C(this,t,e,r,a-1,-a)}var i=0,o=1,l=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===l&&0!==this[e+i-1]&&(l=1),this[e+i]=(t/o>>0)-l&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);C(this,t,e,r,a-1,-a)}var i=r-1,o=1,l=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===l&&0!==this[e+i+1]&&(l=1),this[e+i]=(t/o>>0)-l&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return z(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return z(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var a=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var o=a-1;o>=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return a},i.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var a=t.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(t=a)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var l=i.isBuffer(t)?t:i.from(t,n),s=l.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=l[o%s]}return this};var P=/[^+/0-9A-Za-z-_]/g;function E(t){return t<16?"0"+t.toString(16):t.toString(16)}function I(t,e){var r;e=e||1/0;for(var n=t.length,a=null,i=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!a){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function R(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var a=0;a<n&&!(a+r>=e.length||a>=t.length);++a)e[a+r]=t[a];return a}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function B(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":15,buffer:18,ieee754:56}],19:[function(t,e,r){!function(n,a){"object"==typeof r&&"undefined"!=typeof e?a(r,t("d3-time")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function n(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function a(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function i(t){var i=t.dateTime,o=t.date,s=t.time,c=t.periods,u=t.days,f=t.shortDays,d=t.months,yt=t.shortMonths,xt=p(c),bt=h(c),_t=p(u),wt=h(u),Tt=p(f),kt=h(f),Mt=p(d),At=h(d),Lt=p(yt),St=h(yt),Ct={a:function(t){return f[t.getDay()]},A:function(t){return u[t.getDay()]},b:function(t){return yt[t.getMonth()]},B:function(t){return d[t.getMonth()]},c:null,d:I,e:I,f:H,H:R,I:F,j:N,L:B,m:j,M:U,p:function(t){return c[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:vt,s:mt,S:V,u:q,U:G,V:Z,w:Y,W:X,x:null,X:null,y:W,Y:Q,Z:J,"%":gt},Ot={a:function(t){return f[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return yt[t.getUTCMonth()]},B:function(t){return d[t.getUTCMonth()]},c:null,d:$,e:$,f:nt,H:K,I:tt,j:et,L:rt,m:at,M:it,p:function(t){return c[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:vt,s:mt,S:ot,u:lt,U:st,V:ct,w:ut,W:ft,x:null,X:null,y:dt,Y:pt,Z:ht,"%":gt},Dt={a:function(t,e,r){var n=Tt.exec(e.slice(r));return n?(t.w=kt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=_t.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=Lt.exec(e.slice(r));return n?(t.m=St[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=Mt.exec(e.slice(r));return n?(t.m=At[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return Et(t,i,e,r)},d:M,e:M,f:D,H:L,I:L,j:A,L:O,m:k,M:S,p:function(t,e,r){var n=xt.exec(e.slice(r));return n?(t.p=bt[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:P,s:E,S:C,u:v,U:m,V:y,w:g,W:x,x:function(t,e,r){return Et(t,o,e,r)},X:function(t,e,r){return Et(t,s,e,r)},y:_,Y:b,Z:w,"%":z};function zt(t,e){return function(r){var n,a,i,o=[],s=-1,c=0,u=t.length;for(r instanceof Date||(r=new Date(+r));++s<u;)37===t.charCodeAt(s)&&(o.push(t.slice(c,s)),null!=(a=l[n=t.charAt(++s)])?n=t.charAt(++s):a="e"===n?" ":"0",(i=e[n])&&(n=i(r,a)),o.push(n),c=s+1);return o.push(t.slice(c,s)),o.join("")}}function Pt(t,i){return function(o){var l,s,c=a(1900,void 0,1);if(Et(c,t,o+="",0)!=o.length)return null;if("Q"in c)return new Date(c.Q);if("s"in c)return new Date(1e3*c.s+("L"in c?c.L:0));if(i&&!("Z"in c)&&(c.Z=0),"p"in c&&(c.H=c.H%12+12*c.p),void 0===c.m&&(c.m="q"in c?c.q:0),"V"in c){if(c.V<1||c.V>53)return null;"w"in c||(c.w=1),"Z"in c?(s=(l=n(a(c.y,0,1))).getUTCDay(),l=s>4||0===s?e.utcMonday.ceil(l):e.utcMonday(l),l=e.utcDay.offset(l,7*(c.V-1)),c.y=l.getUTCFullYear(),c.m=l.getUTCMonth(),c.d=l.getUTCDate()+(c.w+6)%7):(s=(l=r(a(c.y,0,1))).getDay(),l=s>4||0===s?e.timeMonday.ceil(l):e.timeMonday(l),l=e.timeDay.offset(l,7*(c.V-1)),c.y=l.getFullYear(),c.m=l.getMonth(),c.d=l.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),s="Z"in c?n(a(c.y,0,1)).getUTCDay():r(a(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(s+5)%7:c.w+7*c.U-(s+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):r(c)}}function Et(t,e,r,n){for(var a,i,o=0,s=e.length,c=r.length;o<s;){if(n>=c)return-1;if(37===(a=e.charCodeAt(o++))){if(a=e.charAt(o++),!(i=Dt[a in l?e.charAt(o++):a])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}return Ct.x=zt(o,Ct),Ct.X=zt(s,Ct),Ct.c=zt(i,Ct),Ot.x=zt(o,Ot),Ot.X=zt(s,Ot),Ot.c=zt(i,Ot),{format:function(t){var e=zt(t+="",Ct);return e.toString=function(){return t},e},parse:function(t){var e=Pt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=zt(t+="",Ot);return e.toString=function(){return t},e},utcParse:function(t){var e=Pt(t+="",!0);return e.toString=function(){return t},e}}}var o,l={"-":"",_:" ",0:"0"},s=/^\s*\d+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/g;function f(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(e)+a:a)}function d(t){return t.replace(u,"\\$&")}function p(t){return new RegExp("^(?:"+t.map(d).join("|")+")","i")}function h(t){for(var e={},r=-1,n=t.length;++r<n;)e[t[r].toLowerCase()]=r;return e}function g(t,e,r){var n=s.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function v(t,e,r){var n=s.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function m(t,e,r){var n=s.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function y(t,e,r){var n=s.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function x(t,e,r){var n=s.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function b(t,e,r){var n=s.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function _(t,e,r){var n=s.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function T(t,e,r){var n=s.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function k(t,e,r){var n=s.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function M(t,e,r){var n=s.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function A(t,e,r){var n=s.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function L(t,e,r){var n=s.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function S(t,e,r){var n=s.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function C(t,e,r){var n=s.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function O(t,e,r){var n=s.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function D(t,e,r){var n=s.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function z(t,e,r){var n=c.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function P(t,e,r){var n=s.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function E(t,e,r){var n=s.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function I(t,e){return f(t.getDate(),e,2)}function R(t,e){return f(t.getHours(),e,2)}function F(t,e){return f(t.getHours()%12||12,e,2)}function N(t,r){return f(1+e.timeDay.count(e.timeYear(t),t),r,3)}function B(t,e){return f(t.getMilliseconds(),e,3)}function H(t,e){return B(t,e)+"000"}function j(t,e){return f(t.getMonth()+1,e,2)}function U(t,e){return f(t.getMinutes(),e,2)}function V(t,e){return f(t.getSeconds(),e,2)}function q(t){var e=t.getDay();return 0===e?7:e}function G(t,r){return f(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function Z(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),f(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function Y(t){return t.getDay()}function X(t,r){return f(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function W(t,e){return f(t.getFullYear()%100,e,2)}function Q(t,e){return f(t.getFullYear()%1e4,e,4)}function J(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+f(e/60|0,"0",2)+f(e%60,"0",2)}function $(t,e){return f(t.getUTCDate(),e,2)}function K(t,e){return f(t.getUTCHours(),e,2)}function tt(t,e){return f(t.getUTCHours()%12||12,e,2)}function et(t,r){return f(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return f(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function at(t,e){return f(t.getUTCMonth()+1,e,2)}function it(t,e){return f(t.getUTCMinutes(),e,2)}function ot(t,e){return f(t.getUTCSeconds(),e,2)}function lt(t){var e=t.getUTCDay();return 0===e?7:e}function st(t,r){return f(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ct(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),f(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ut(t){return t.getUTCDay()}function ft(t,r){return f(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function dt(t,e){return f(t.getUTCFullYear()%100,e,2)}function pt(t,e){return f(t.getUTCFullYear()%1e4,e,4)}function ht(){return"+0000"}function gt(){return"%"}function vt(t){return+t}function mt(t){return Math.floor(+t/1e3)}function yt(e){return o=i(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}yt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var xt=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var bt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");t.isoFormat=xt,t.isoParse=bt,t.timeFormatDefaultLocale=yt,t.timeFormatLocale=i,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":20}],20:[function(t,e,r){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e=new Date,r=new Date;function n(t,a,i,o){function l(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return l.floor=function(e){return t(e=new Date(+e)),e},l.ceil=function(e){return t(e=new Date(e-1)),a(e,1),t(e),e},l.round=function(t){var e=l(t),r=l.ceil(t);return t-e<r-t?e:r},l.offset=function(t,e){return a(t=new Date(+t),null==e?1:Math.floor(e)),t},l.range=function(e,r,n){var i,o=[];if(e=l.ceil(e),n=null==n?1:Math.floor(n),!(e<r&&n>0))return o;do{o.push(i=new Date(+e)),a(e,n),t(e)}while(i<e&&e<r);return o},l.filter=function(e){return n((function(r){if(r>=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;a(t,-1),!e(t););else for(;--r>=0;)for(;a(t,1),!e(t););}))},i&&(l.count=function(n,a){return e.setTime(+n),r.setTime(+a),t(e),t(r),Math.floor(i(e,r))},l.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?l.filter(o?function(e){return o(e)%t==0}:function(e){return l.count(0,e)%t==0}):l:null}),l}var a=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));a.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):a:null};var i=a.range,o=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),l=o.range,s=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),c=s.range,u=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),f=u.range,d=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),p=d.range;function h(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var g=h(0),v=h(1),m=h(2),y=h(3),x=h(4),b=h(5),_=h(6),w=g.range,T=v.range,k=m.range,M=y.range,A=x.range,L=b.range,S=_.range,C=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),O=C.range,D=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));D.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var z=D.range,P=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})),E=P.range,I=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()})),R=I.range,F=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),N=F.range;function B(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var H=B(0),j=B(1),U=B(2),V=B(3),q=B(4),G=B(5),Z=B(6),Y=H.range,X=j.range,W=U.range,Q=V.range,J=q.range,$=G.range,K=Z.range,tt=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),et=tt.range,rt=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));rt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var nt=rt.range;t.timeDay=d,t.timeDays=p,t.timeFriday=b,t.timeFridays=L,t.timeHour=u,t.timeHours=f,t.timeInterval=n,t.timeMillisecond=a,t.timeMilliseconds=i,t.timeMinute=s,t.timeMinutes=c,t.timeMonday=v,t.timeMondays=T,t.timeMonth=C,t.timeMonths=O,t.timeSaturday=_,t.timeSaturdays=S,t.timeSecond=o,t.timeSeconds=l,t.timeSunday=g,t.timeSundays=w,t.timeThursday=x,t.timeThursdays=A,t.timeTuesday=m,t.timeTuesdays=k,t.timeWednesday=y,t.timeWednesdays=M,t.timeWeek=g,t.timeWeeks=w,t.timeYear=D,t.timeYears=z,t.utcDay=F,t.utcDays=N,t.utcFriday=G,t.utcFridays=$,t.utcHour=I,t.utcHours=R,t.utcMillisecond=a,t.utcMilliseconds=i,t.utcMinute=P,t.utcMinutes=E,t.utcMonday=j,t.utcMondays=X,t.utcMonth=tt,t.utcMonths=et,t.utcSaturday=Z,t.utcSaturdays=K,t.utcSecond=o,t.utcSeconds=l,t.utcSunday=H,t.utcSundays=Y,t.utcThursday=q,t.utcThursdays=J,t.utcTuesday=U,t.utcTuesdays=W,t.utcWednesday=V,t.utcWednesdays=Q,t.utcWeek=H,t.utcWeeks=Y,t.utcYear=rt,t.utcYears=nt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],21:[function(t,e,r){!function(){var t={version:"3.5.17"},r=[].slice,n=function(t){return r.call(t)},a=this.document;function i(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(t){n=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var l=this.Element.prototype,s=l.setAttribute,c=l.setAttributeNS,u=this.CSSStyleDeclaration.prototype,f=u.setProperty;l.setAttribute=function(t,e){s.call(this,t,e+"")},l.setAttributeNS=function(t,e,r){c.call(this,t,e,r+"")},u.setProperty=function(t,e,r){f.call(this,t,e+"",r)}}function d(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function h(t){return!isNaN(t)}function g(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var i=n+a>>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var i=n+a>>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}t.ascending=d,t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.min=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=t[a])&&r>n&&(r=n)}else{for(;++a<i;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=e.call(t,t[a],a))&&r>n&&(r=n)}return r},t.max=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=t[a])&&n>r&&(r=n)}else{for(;++a<i;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=e.call(t,t[a],a))&&n>r&&(r=n)}return r},t.extent=function(t,e){var r,n,a,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(n=t[i])&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=t[i])&&(r>n&&(r=n),a<n&&(a=n))}else{for(;++i<o;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=e.call(t,t[i],i))&&(r>n&&(r=n),a<n&&(a=n))}return[r,a]},t.sum=function(t,e){var r,n=0,a=t.length,i=-1;if(1===arguments.length)for(;++i<a;)h(r=+t[i])&&(n+=r);else for(;++i<a;)h(r=+e.call(t,t[i],i))&&(n+=r);return n},t.mean=function(t,e){var r,n=0,a=t.length,i=-1,o=a;if(1===arguments.length)for(;++i<a;)h(r=p(t[i]))?n+=r:--o;else for(;++i<a;)h(r=p(e.call(t,t[i],i)))?n+=r:--o;if(o)return n/o},t.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),a=+t[n-1],i=r-n;return i?a+i*(t[n]-a):a},t.median=function(e,r){var n,a=[],i=e.length,o=-1;if(1===arguments.length)for(;++o<i;)h(n=p(e[o]))&&a.push(n);else for(;++o<i;)h(n=p(r.call(e,e[o],o)))&&a.push(n);if(a.length)return t.quantile(a.sort(d),.5)},t.variance=function(t,e){var r,n,a=t.length,i=0,o=0,l=-1,s=0;if(1===arguments.length)for(;++l<a;)h(r=p(t[l]))&&(o+=(n=r-i)*(r-(i+=n/++s)));else for(;++l<a;)h(r=p(e.call(t,t[l],l)))&&(o+=(n=r-i)*(r-(i+=n/++s)));if(s>1)return o/(s-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=g(d);function m(t){return t.length}t.bisectLeft=v.left,t.bisect=t.bisectRight=v.right,t.bisector=function(t){return g(1===t.length?function(e,r){return d(t(e),r)}:t)},t.shuffle=function(t,e,r){(i=arguments.length)<3&&(r=t.length,i<2&&(e=0));for(var n,a,i=r-e;i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e<r;)a[e]=[n,n=t[++e]];return a},t.transpose=function(e){if(!(i=e.length))return[];for(var r=-1,n=t.min(e,m),a=new Array(n);++r<n;)for(var i,o=-1,l=a[r]=new Array(i);++o<i;)l[o]=e[o][r];return a},t.zip=function(){return t.transpose(arguments)},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},t.merge=function(t){for(var e,r,n,a=t.length,i=-1,o=0;++i<a;)o+=t[i].length;for(r=new Array(o);--a>=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function x(t){for(var e=1;t*e%1;)e*=10;return e}function b(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function _(){this._=Object.create(null)}t.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,a=[],i=x(y(r)),o=-1;if(t*=i,e*=i,(r*=i)<0)for(;(n=t+r*++o)>e;)a.push(n/i);else for(;(n=t+r*++o)<e;)a.push(n/i);return a},t.map=function(t,e){var r=new _;if(t instanceof _)t.forEach((function(t,e){r.set(t,e)}));else if(Array.isArray(t)){var n,a=-1,i=t.length;if(1===arguments.length)for(;++a<i;)r.set(a,t[a]);else for(;++a<i;)r.set(e.call(t,n=t[a],a),n)}else for(var o in t)r.set(o,t[o]);return r};function w(t){return"__proto__"==(t+="")||"\0"===t[0]?"\0"+t:t}function T(t){return"\0"===(t+="")[0]?t.slice(1):t}function k(t){return w(t)in this._}function M(t){return(t=w(t))in this._&&delete this._[t]}function A(){var t=[];for(var e in this._)t.push(T(e));return t}function L(){var t=0;for(var e in this._)++t;return t}function S(){for(var t in this._)return!1;return!0}function C(){this._=Object.create(null)}function O(t){return t}function D(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function z(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=P.length;r<n;++r){var a=P[r]+e;if(a in t)return a}}b(_,{has:k,get:function(t){return this._[w(t)]},set:function(t,e){return this._[w(t)]=e},remove:M,keys:A,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:T(e),value:this._[e]});return t},size:L,empty:S,forEach:function(t){for(var e in this._)t.call(this,T(e),this._[e])}}),t.nest=function(){var e,r,n={},a=[],i=[];function o(t,i,l){if(l>=a.length)return r?r.call(n,i):e?i.sort(e):i;for(var s,c,u,f,d=-1,p=i.length,h=a[l++],g=new _;++d<p;)(f=g.get(s=h(c=i[d])))?f.push(c):g.set(s,[c]);return t?(c=t(),u=function(e,r){c.set(e,o(t,r,l))}):(c={},u=function(e,r){c[e]=o(t,r,l)}),g.forEach(u),c}return n.map=function(t,e){return o(e,t,0)},n.entries=function(e){return function t(e,r){if(r>=a.length)return e;var n=[],o=i[r++];return e.forEach((function(e,a){n.push({key:e,values:t(a,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return a.push(t),n},n.sortKeys=function(t){return i[a.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new C;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},b(C,{has:k,add:function(t){return this._[w(t+="")]=!0,t},remove:M,values:A,size:L,empty:S,forEach:function(t){for(var e in this._)t.call(this,T(e))}}),t.behavior={},t.rebind=function(t,e){for(var r,n=1,a=arguments.length;++n<a;)t[r=arguments[n]]=D(t,e,e[r]);return t};var P=["webkit","ms","moz","Moz","o","O"];function E(){}function I(){}function R(t){var e=[],r=new _;function n(){for(var r,n=e,a=-1,i=n.length;++a<i;)(r=n[a].on)&&r.apply(this,arguments);return t}return n.on=function(n,a){var i,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,i=e.indexOf(o)).concat(e.slice(i+1)),r.remove(n)),a&&e.push(r.set(n,{on:a})),t)},n}function F(){t.event.preventDefault()}function N(){for(var e,r=t.event;e=r.sourceEvent;)r=e;return r}function B(e){for(var r=new I,n=0,a=arguments.length;++n<a;)r[arguments[n]]=R(r);return r.of=function(n,a){return function(i){try{var o=i.sourceEvent=t.event;i.target=e,t.event=i,r[i.type].apply(n,a)}finally{t.event=o}}},r}t.dispatch=function(){for(var t=new I,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=R(t);return t},I.prototype.on=function(t,e){var r=t.indexOf("."),n="";if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(H,"\\$&")};var H=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,j={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function U(t){return j(t,Z),t}var V=function(t,e){return e.querySelector(t)},q=function(t,e){return e.querySelectorAll(t)},G=function(t,e){var r=t.matches||t[z(t,"matchesSelector")];return(G=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(V=function(t,e){return Sizzle(t,e)[0]||null},q=Sizzle,G=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var Z=t.selection.prototype=[];function Y(t){return"function"==typeof t?t:function(){return V(t,this)}}function X(t){return"function"==typeof t?t:function(){return q(t,this)}}Z.select=function(t){var e,r,n,a,i=[];t=Y(t);for(var o=-1,l=this.length;++o<l;){i.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var s=-1,c=n.length;++s<c;)(a=n[s])?(e.push(r=t.call(a,a.__data__,s,o)),r&&"__data__"in a&&(r.__data__=a.__data__)):e.push(null)}return U(i)},Z.selectAll=function(t){var e,r,a=[];t=X(t);for(var i=-1,o=this.length;++i<o;)for(var l=this[i],s=-1,c=l.length;++s<c;)(r=l[s])&&(a.push(e=n(t.call(r,r.__data__,s,i))),e.parentNode=r);return U(a)};var W="http://www.w3.org/1999/xhtml",Q={svg:"http://www.w3.org/2000/svg",xhtml:W,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function J(e,r){return e=t.ns.qualify(e),null==r?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:"function"==typeof r?e.local?function(){var t=r.apply(this,arguments);null==t?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}:function(){var t=r.apply(this,arguments);null==t?this.removeAttribute(e):this.setAttribute(e,t)}:e.local?function(){this.setAttributeNS(e.space,e.local,r)}:function(){this.setAttribute(e,r)}}function $(t){return t.trim().replace(/\s+/g," ")}function K(e){return new RegExp("(?:^|\\s+)"+t.requote(e)+"(?:\\s+|$)","g")}function tt(t){return(t+"").trim().split(/^|\s+/)}function et(t,e){var r=(t=tt(t).map(rt)).length;return"function"==typeof e?function(){for(var n=-1,a=e.apply(this,arguments);++n<r;)t[n](this,a)}:function(){for(var n=-1;++n<r;)t[n](this,e)}}function rt(t){var e=K(t);return function(r,n){if(a=r.classList)return n?a.add(t):a.remove(t);var a=r.getAttribute("class")||"";n?(e.lastIndex=0,e.test(a)||r.setAttribute("class",$(a+" "+t))):r.setAttribute("class",$(a.replace(e," ")))}}function nt(t,e,r){return null==e?function(){this.style.removeProperty(t)}:"function"==typeof e?function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}:function(){this.style.setProperty(t,e,r)}}function at(t,e){return null==e?function(){delete this[t]}:"function"==typeof e?function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}:function(){this[t]=e}}function it(e){return"function"==typeof e?e:(e=t.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,r=this.namespaceURI;return r===W&&t.documentElement.namespaceURI===W?t.createElement(e):t.createElementNS(r,e)}}function ot(){var t=this.parentNode;t&&t.removeChild(this)}function lt(t){return{__data__:t}}function st(t){return function(){return G(this,t)}}function ct(t){return arguments.length||(t=d),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}function ut(t,e){for(var r=0,n=t.length;r<n;r++)for(var a,i=t[r],o=0,l=i.length;o<l;o++)(a=i[o])&&e(a,o,r);return t}function ft(t){return j(t,dt),t}t.ns={prefix:Q,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),Q.hasOwnProperty(r)?{space:Q[r],local:t}:t}},Z.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(J(r,e[r]));return this}return this.each(J(e,r))},Z.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=tt(t)).length,a=-1;if(e=r.classList){for(;++a<n;)if(!e.contains(t[a]))return!1}else for(e=r.getAttribute("class");++a<n;)if(!K(t[a]).test(e))return!1;return!0}for(e in t)this.each(et(e,t[e]));return this}return this.each(et(t,e))},Z.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.each(nt(r,t[r],e));return this}if(n<2){var a=this.node();return o(a).getComputedStyle(a,null).getPropertyValue(t)}r=""}return this.each(nt(t,e,r))},Z.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(at(e,t[e]));return this}return this.each(at(t,e))},Z.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},Z.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},Z.append=function(t){return t=it(t),this.select((function(){return this.appendChild(t.apply(this,arguments))}))},Z.insert=function(t,e){return t=it(t),e=Y(e),this.select((function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)}))},Z.remove=function(){return this.each(ot)},Z.data=function(t,e){var r,n,a=-1,i=this.length;if(!arguments.length){for(t=new Array(i=(r=this[0]).length);++a<i;)(n=r[a])&&(t[a]=n.__data__);return t}function o(t,r){var n,a,i,o=t.length,u=r.length,f=Math.min(o,u),d=new Array(u),p=new Array(u),h=new Array(o);if(e){var g,v=new _,m=new Array(o);for(n=-1;++n<o;)(a=t[n])&&(v.has(g=e.call(a,a.__data__,n))?h[n]=a:v.set(g,a),m[n]=g);for(n=-1;++n<u;)(a=v.get(g=e.call(r,i=r[n],n)))?!0!==a&&(d[n]=a,a.__data__=i):p[n]=lt(i),v.set(g,!0);for(n=-1;++n<o;)n in m&&!0!==v.get(m[n])&&(h[n]=t[n])}else{for(n=-1;++n<f;)a=t[n],i=r[n],a?(a.__data__=i,d[n]=a):p[n]=lt(i);for(;n<u;++n)p[n]=lt(r[n]);for(;n<o;++n)h[n]=t[n]}p.update=d,p.parentNode=d.parentNode=h.parentNode=t.parentNode,l.push(p),s.push(d),c.push(h)}var l=ft([]),s=U([]),c=U([]);if("function"==typeof t)for(;++a<i;)o(r=this[a],t.call(r,r.parentNode.__data__,a));else for(;++a<i;)o(r=this[a],t);return s.enter=function(){return l},s.exit=function(){return c},s},Z.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},Z.filter=function(t){var e,r,n,a=[];"function"!=typeof t&&(t=st(t));for(var i=0,o=this.length;i<o;i++){a.push(e=[]),e.parentNode=(r=this[i]).parentNode;for(var l=0,s=r.length;l<s;l++)(n=r[l])&&t.call(n,n.__data__,l,i)&&e.push(n)}return U(a)},Z.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],a=n.length-1,i=n[a];--a>=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},Z.sort=function(t){t=ct.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},Z.each=function(t){return ut(this,(function(e,r,n){t.call(e,e.__data__,r,n)}))},Z.call=function(t){var e=n(arguments);return t.apply(e[0]=this,e),this},Z.empty=function(){return!this.node()},Z.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,a=r.length;n<a;n++){var i=r[n];if(i)return i}return null},Z.size=function(){var t=0;return ut(this,(function(){++t})),t};var dt=[];function pt(t){var e,r;return function(n,a,i){var o,l=t[i].update,s=l.length;for(i!=r&&(r=i,e=0),a>=e&&(e=a+1);!(o=l[e])&&++e<s;);return o}}function ht(e,r,a){var i="__on"+e,o=e.indexOf("."),l=vt;o>0&&(e=e.slice(0,o));var s=gt.get(e);function c(){var t=this[i];t&&(this.removeEventListener(e,t,t.$),delete this[i])}return s&&(e=s,l=mt),o?r?function(){var t=l(r,n(arguments));c.call(this),this.addEventListener(e,this[i]=t,t.$=a),t._=r}:c:r?E:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}t.selection.enter=ft,t.selection.enter.prototype=dt,dt.append=Z.append,dt.empty=Z.empty,dt.node=Z.node,dt.call=Z.call,dt.size=Z.size,dt.select=function(t){for(var e,r,n,a,i,o=[],l=-1,s=this.length;++l<s;){n=(a=this[l]).update,o.push(e=[]),e.parentNode=a.parentNode;for(var c=-1,u=a.length;++c<u;)(i=a[c])?(e.push(n[c]=r=t.call(a.parentNode,i.__data__,c,l)),r.__data__=i.__data__):e.push(null)}return U(o)},dt.insert=function(t,e){return arguments.length<2&&(e=pt(this)),Z.insert.call(this,t,e)},t.select=function(t){var e;return"string"==typeof t?(e=[V(t,a)]).parentNode=a.documentElement:(e=[t]).parentNode=i(t),U([e])},t.selectAll=function(t){var e;return"string"==typeof t?(e=n(q(t,a))).parentNode=a.documentElement:(e=n(t)).parentNode=null,U([e])},Z.on=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=!1),t)this.each(ht(r,t[r],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(ht(t,e,r))};var gt=t.map({mouseenter:"mouseover",mouseleave:"mouseout"});function vt(e,r){return function(n){var a=t.event;t.event=n,r[0]=this.__data__;try{e.apply(this,r)}finally{t.event=a}}}function mt(t,e){var r=vt(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}a&&gt.forEach((function(t){"on"+t in a&&gt.remove(t)}));var yt,xt=0;function bt(e){var r=".dragsuppress-"+ ++xt,n="click"+r,a=t.select(o(e)).on("touchmove"+r,F).on("dragstart"+r,F).on("selectstart"+r,F);if(null==yt&&(yt=!("onselectstart"in e)&&z(e.style,"userSelect")),yt){var l=i(e).style,s=l[yt];l[yt]="none"}return function(t){if(a.on(r,null),yt&&(l[yt]=s),t){var e=function(){a.on(n,null)};a.on(n,(function(){F(),e()}),!0),setTimeout(e,0)}}}t.mouse=function(t){return wt(t,N())};var _t=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function wt(e,r){r.changedTouches&&(r=r.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var a=n.createSVGPoint();if(_t<0){var i=o(e);if(i.scrollX||i.scrollY){var l=(n=t.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();_t=!(l.f||l.e),n.remove()}}return _t?(a.x=r.pageX,a.y=r.pageY):(a.x=r.clientX,a.y=r.clientY),[(a=a.matrixTransform(e.getScreenCTM().inverse())).x,a.y]}var s=e.getBoundingClientRect();return[r.clientX-s.left-e.clientLeft,r.clientY-s.top-e.clientTop]}function Tt(){return t.event.changedTouches[0].identifier}t.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=N().changedTouches),e)for(var n,a=0,i=e.length;a<i;++a)if((n=e[a]).identifier===r)return wt(t,n)},t.behavior.drag=function(){var e=B(i,"drag","dragstart","dragend"),r=null,n=l(E,t.mouse,o,"mousemove","mouseup"),a=l(Tt,t.touch,O,"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=t.event.target.correspondingElement||t.event.target,f=c.parentNode,d=e.of(c,arguments),p=0,h=n(),g=".drag"+(null==h?"":"-"+h),v=t.select(i(u)).on(o+g,x).on(l+g,b),m=bt(u),y=a(f,h);function x(){var t,e,r=a(f,h);r&&(t=r[0]-y[0],e=r[1]-y[1],p|=t|e,y=r,d({type:"drag",x:r[0]+s[0],y:r[1]+s[1],dx:t,dy:e}))}function b(){a(f,h)&&(v.on(o+g,null).on(l+g,null),m(p),d({type:"dragend"}))}s=r?[(s=r.apply(c,arguments)).x-y[0],s.y-y[1]]:[0,0],d({type:"dragstart"})}}return i.origin=function(t){return arguments.length?(r=t,i):r},t.rebind(i,e,"on")},t.touches=function(t,e){return arguments.length<2&&(e=N().touches),e?n(e).map((function(e){var r=wt(t,e);return r.identifier=e.identifier,r})):[]};var kt=1e-6,Mt=1e-12,At=Math.PI,Lt=2*At,St=Lt-kt,Ct=At/2,Ot=At/180,Dt=180/At;function zt(t){return t>0?1:t<0?-1:0}function Pt(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function Et(t){return t>1?0:t<-1?At:Math.acos(t)}function It(t){return t>1?Ct:t<-1?-Ct:Math.asin(t)}function Rt(t){return((t=Math.exp(t))+1/t)/2}function Ft(t){return(t=Math.sin(t/2))*t}var Nt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],l=e[0],s=e[1],c=e[2],u=l-a,f=s-i,d=u*u+f*f;if(d<Mt)n=Math.log(c/o)/Nt,r=function(t){return[a+t*u,i+t*f,o*Math.exp(Nt*t*n)]};else{var p=Math.sqrt(d),h=(c*c-o*o+4*d)/(2*o*2*p),g=(c*c-o*o-4*d)/(2*c*2*p),v=Math.log(Math.sqrt(h*h+1)-h),m=Math.log(Math.sqrt(g*g+1)-g);n=(m-v)/Nt,r=function(t){var e,r=t*n,l=Rt(v),s=o/(2*p)*(l*(e=Nt*r+v,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[a+s*u,i+s*f,o*l/Rt(Nt*r+v)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,i,l,s,c,u,f,d={x:0,y:0,k:1},p=[960,500],h=jt,g=250,v=0,m="mousedown.zoom",y="mousemove.zoom",x="mouseup.zoom",b="touchstart.zoom",_=B(w,"zoomstart","zoom","zoomend");function w(t){t.on(m,D).on(Ht+".zoom",P).on("dblclick.zoom",E).on(b,z)}function T(t){return[(t[0]-d.x)/d.k,(t[1]-d.y)/d.k]}function k(t){d.k=Math.max(h[0],Math.min(h[1],t))}function M(t,e){e=function(t){return[t[0]*d.k+d.x,t[1]*d.k+d.y]}(e),d.x+=t[0]-e[0],d.y+=t[1]-e[1]}function A(e,n,a,i){e.__chart__={x:d.x,y:d.y,k:d.k},k(Math.pow(2,i)),M(r=n,a),e=t.select(e),g>0&&(e=e.transition().duration(g)),e.call(w.event)}function L(){c&&c.domain(s.range().map((function(t){return(t-d.x)/d.k})).map(s.invert)),f&&f.domain(u.range().map((function(t){return(t-d.y)/d.k})).map(u.invert))}function S(t){v++||t({type:"zoomstart"})}function C(t){L(),t({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function O(t){--v||(t({type:"zoomend"}),r=null)}function D(){var e=this,r=_.of(e,arguments),n=0,a=t.select(o(e)).on(y,s).on(x,c),i=T(t.mouse(e)),l=bt(e);function s(){n=1,M(t.mouse(e),i),C(r)}function c(){a.on(y,null).on(x,null),l(n),O(r)}ml.call(e),S(r)}function z(){var e,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+t.event.changedTouches[0].identifier,s="touchmove"+o,c="touchend"+o,u=[],f=t.select(r),p=bt(r);function h(){var n=t.touches(r);return e=d.k,n.forEach((function(t){t.identifier in a&&(a[t.identifier]=T(t))})),n}function g(){var e=t.event.target;t.select(e).on(s,v).on(c,y),u.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o<f;++o)a[n[o].identifier]=null;var p=h(),g=Date.now();if(1===p.length){if(g-l<500){var m=p[0];A(r,m,a[m.identifier],Math.floor(Math.log(d.k)/Math.LN2)+1),F()}l=g}else if(p.length>1){m=p[0];var x=p[1],b=m[0]-x[0],_=m[1]-x[1];i=b*b+_*_}}function v(){var o,s,c,u,f=t.touches(r);ml.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],k(g*e)}l=null,M(o,s),C(n)}function y(){if(t.event.touches.length){for(var e=t.event.changedTouches,r=0,i=e.length;r<i;++r)delete a[e[r].identifier];for(var l in a)return void h()}t.selectAll(u).on(o,null),f.on(m,D).on(b,z),p(),O(n)}g(),S(n),f.on(m,null).on(b,g)}function P(){var a=_.of(this,arguments);i?clearTimeout(i):(ml.call(this),e=T(r=n||t.mouse(this)),S(a)),i=setTimeout((function(){i=null,O(a)}),50),F(),k(Math.pow(2,.002*Bt())*d.k),M(r,e),C(a)}function E(){var e=t.mouse(this),r=Math.log(d.k)/Math.LN2;A(this,e,T(e),t.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return Ht||(Ht="onwheel"in a?(Bt=function(){return-t.event.deltaY*(t.event.deltaMode?120:1)},"wheel"):"onmousewheel"in a?(Bt=function(){return t.event.wheelDelta},"mousewheel"):(Bt=function(){return-t.event.detail},"MozMousePixelScroll")),w.event=function(e){e.each((function(){var e=_.of(this,arguments),n=d;bl?t.select(this).transition().each("start.zoom",(function(){d=this.__chart__||{x:0,y:0,k:1},S(e)})).tween("zoom:zoom",(function(){var a=p[0],i=p[1],o=r?r[0]:a/2,l=r?r[1]:i/2,s=t.interpolateZoom([(o-d.x)/d.k,(l-d.y)/d.k,a/d.k],[(o-n.x)/n.k,(l-n.y)/n.k,a/n.k]);return function(t){var r=s(t),n=a/r[2];this.__chart__=d={x:o-r[0]*n,y:l-r[1]*n,k:n},C(e)}})).each("interrupt.zoom",(function(){O(e)})).each("end.zoom",(function(){O(e)})):(this.__chart__=d,S(e),C(e),O(e))}))},w.translate=function(t){return arguments.length?(d={x:+t[0],y:+t[1],k:d.k},L(),w):[d.x,d.y]},w.scale=function(t){return arguments.length?(d={x:d.x,y:d.y,k:null},k(+t),L(),w):d.k},w.scaleExtent=function(t){return arguments.length?(h=null==t?jt:[+t[0],+t[1]],w):h},w.center=function(t){return arguments.length?(n=t&&[+t[0],+t[1]],w):n},w.size=function(t){return arguments.length?(p=t&&[+t[0],+t[1]],w):p},w.duration=function(t){return arguments.length?(g=+t,w):g},w.x=function(t){return arguments.length?(c=t,s=t.copy(),d={x:0,y:0,k:1},w):c},w.y=function(t){return arguments.length?(f=t,u=t.copy(),d={x:0,y:0,k:1},w):f},t.rebind(w,_,"on")};var Bt,Ht,jt=[0,1/0];function Ut(){}function Vt(t,e,r){return this instanceof Vt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof Vt?new Vt(t.h,t.s,t.l):se(""+t,ce,Vt):new Vt(t,e,r)}t.color=Ut,Ut.prototype.toString=function(){return this.rgb()+""},t.hsl=Vt;var qt=Vt.prototype=new Ut;function Gt(t,e,r){var n,a;function i(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?n+(a-n)*t/60:t<180?a:t<240?n+(a-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+e):r+e-r*e),new ne(i(t+120),i(t),i(t-120))}function Zt(e,r,n){return this instanceof Zt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Zt?new Zt(e.h,e.c,e.l):Kt(e instanceof Wt?e.l:(e=ue((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Zt(e,r,n)}qt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,this.l/t)},qt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,t*this.l)},qt.rgb=function(){return Gt(this.h,this.s,this.l)},t.hcl=Zt;var Yt=Zt.prototype=new Ut;function Xt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Wt(r,Math.cos(t*=Ot)*e,Math.sin(t)*e)}function Wt(t,e,r){return this instanceof Wt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Wt?new Wt(t.l,t.a,t.b):t instanceof Zt?Xt(t.h,t.c,t.l):ue((t=ne(t)).r,t.g,t.b):new Wt(t,e,r)}Yt.brighter=function(t){return new Zt(this.h,this.c,Math.min(100,this.l+Qt*(arguments.length?t:1)))},Yt.darker=function(t){return new Zt(this.h,this.c,Math.max(0,this.l-Qt*(arguments.length?t:1)))},Yt.rgb=function(){return Xt(this.h,this.c,this.l).rgb()},t.lab=Wt;var Qt=18,Jt=Wt.prototype=new Ut;function $t(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return new ne(re(3.2404542*(a=.95047*te(a))-1.5371385*(n=1*te(n))-.4985314*(i=1.08883*te(i))),re(-.969266*a+1.8760108*n+.041556*i),re(.0556434*a-.2040259*n+1.0572252*i))}function Kt(t,e,r){return t>0?new Zt(Math.atan2(r,e)*Dt,Math.sqrt(e*e+r*r),t):new Zt(NaN,NaN,t)}function te(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ee(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function re(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ne(t,e,r){return this instanceof ne?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ne?new ne(t.r,t.g,t.b):se(""+t,ne,Gt):new ne(t,e,r)}function ae(t){return new ne(t>>16,t>>8&255,255&t)}function ie(t){return ae(t)+""}Jt.brighter=function(t){return new Wt(Math.min(100,this.l+Qt*(arguments.length?t:1)),this.a,this.b)},Jt.darker=function(t){return new Wt(Math.max(0,this.l-Qt*(arguments.length?t:1)),this.a,this.b)},Jt.rgb=function(){return $t(this.l,this.a,this.b)},t.rgb=ne;var oe=ne.prototype=new Ut;function le(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function se(t,e,r){var n,a,i,o=0,l=0,s=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(de(a[0]),de(a[1]),de(a[2]))}return(i=pe.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&i)>>4,o|=o>>4,l=240&i,l|=l>>4,s=15&i,s|=s<<4):7===t.length&&(o=(16711680&i)>>16,l=(65280&i)>>8,s=255&i)),e(o,l,s))}function ce(t,e,r){var n,a,i=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),l=o-i,s=(o+i)/2;return l?(a=s<.5?l/(o+i):l/(2-o-i),n=t==o?(e-r)/l+(e<r?6:0):e==o?(r-t)/l+2:(t-e)/l+4,n*=60):(n=NaN,a=s>0&&s<1?0:n),new Vt(n,a,s)}function ue(t,e,r){var n=ee((.4124564*(t=fe(t))+.3575761*(e=fe(e))+.1804375*(r=fe(r)))/.95047),a=ee((.2126729*t+.7151522*e+.072175*r)/1);return Wt(116*a-16,500*(n-a),200*(a-ee((.0193339*t+.119192*e+.9503041*r)/1.08883)))}function fe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function de(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}oe.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e<a&&(e=a),r&&r<a&&(r=a),n&&n<a&&(n=a),new ne(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new ne(a,a,a)},oe.darker=function(t){return new ne((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},oe.hsl=function(){return ce(this.r,this.g,this.b)},oe.toString=function(){return"#"+le(this.r)+le(this.g)+le(this.b)};var pe=t.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function he(t){return"function"==typeof t?t:function(){return t}}function ge(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),ve(e,r,t,n)}}function ve(e,r,a,i){var o={},l=t.dispatch("beforesend","progress","load","error"),s={},c=new XMLHttpRequest,u=null;function f(){var t,e=c.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(c)||e>=200&&e<300||304===e){try{t=a.call(o,c)}catch(t){return void l.error.call(o,t)}l.load.call(o,t)}else l.error.call(o,c)}return this.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(e)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(e){var r=t.event;t.event=e;try{l.progress.call(o,c)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return a=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),c.open(t,e,!0),null==r||"accept"in s||(s.accept=r+",*/*"),c.setRequestHeader)for(var i in s)c.setRequestHeader(i,s[i]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=a&&o.on("error",a).on("load",(function(t){a(null,t)})),l.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},t.rebind(o,l,"on"),null==i?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(i))}pe.forEach((function(t,e){pe.set(t,ae(e))})),t.functor=he,t.xhr=ge(O),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function a(t,r,n){arguments.length<3&&(n=r,r=null);var a=ve(t,e,null==r?i:o(r),n);return a.row=function(t){return arguments.length?a.response(null==(r=t)?i:o(t)):r},a}function i(t){return a.parse(t.responseText)}function o(t){return function(e){return a.parse(e.responseText,t)}}function l(e){return e.map(s).join(t)}function s(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,e){var r;return a.parseRows(t,(function(t,n){if(r)return r(t,n-1);var a=new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+"]"})).join(",")+"}");r=e?function(t,r){return e(a(t),r)}:a}))},a.parseRows=function(t,e){var r,a,i={},o={},l=[],s=t.length,c=0,u=0;function f(){if(c>=s)return o;if(a)return a=!1,i;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++<s;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return c=r+2,13===(l=t.charCodeAt(r+1))?(a=!0,10===t.charCodeAt(r+2)&&++c):10===l&&(a=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;c<s;){var l,u=1;if(10===(l=t.charCodeAt(c++)))a=!0;else if(13===l)a=!0,10===t.charCodeAt(c)&&(++c,++u);else if(l!==n)continue;return t.slice(e,c-u)}return t.slice(e)}for(;(r=f())!==o;){for(var d=[];r!==i&&r!==o;)d.push(r),r=f();e&&null==(d=e(d,u++))||l.push(d)}return l},a.format=function(e){if(Array.isArray(e[0]))return a.formatRows(e);var r=new C,n=[];return e.forEach((function(t){for(var e in t)r.has(e)||n.push(r.add(e))})),[n.map(s).join(t)].concat(e.map((function(e){return n.map((function(t){return s(e[t])})).join(t)}))).join("\n")},a.formatRows=function(t){return t.map(l).join("\n")},a},t.csv=t.dsv(",","text/csv"),t.tsv=t.dsv("\t","text/tab-separated-values");var me,ye,xe,be,_e=this[z(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};function we(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var a=r+e,i={c:t,t:a,n:null};return ye?ye.n=i:me=i,ye=i,xe||(be=clearTimeout(be),xe=1,_e(Te)),i}function Te(){var t=ke(),e=Me()-t;e>24?(isFinite(e)&&(clearTimeout(be),be=setTimeout(Te,e)),xe=0):(xe=1,_e(Te))}function ke(){for(var t=Date.now(),e=me;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Me(){for(var t,e=me,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:me=e.n;return ye=t,r}function Ae(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}t.timer=function(){we.apply(this,arguments)},t.timer.flush=function(){ke(),Me()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var Le=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map((function(t,e){var r=Math.pow(10,3*y(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}}));function Se(e){var r=e.decimal,n=e.thousands,a=e.grouping,i=e.currency,o=a&&n?function(t,e){for(var r=t.length,i=[],o=0,l=a[0],s=0;r>0&&l>0&&(s+l+1>e&&(l=Math.max(1,e-s)),i.push(t.substring(r-=l,r+l)),!((s+=l+1)>e));)l=a[o=(o+1)%a.length];return i.reverse().join(n)}:O;return function(e){var n=Ce.exec(e),a=n[1]||" ",l=n[2]||">",s=n[3]||"-",c=n[4]||"",u=n[5],f=+n[6],d=n[7],p=n[8],h=n[9],g=1,v="",m="",y=!1,x=!0;switch(p&&(p=+p.substring(1)),(u||"0"===a&&"="===l)&&(u=a="0",l="="),h){case"n":d=!0,h="g";break;case"%":g=100,m="%",h="f";break;case"p":g=100,m="%",h="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+h.toLowerCase());case"c":x=!1;case"d":y=!0,p=0;break;case"s":g=-1,h="r"}"$"===c&&(v=i[0],m=i[1]),"r"!=h||p||(h="g"),null!=p&&("g"==h?p=Math.max(1,Math.min(21,p)):"e"!=h&&"f"!=h||(p=Math.max(0,Math.min(20,p)))),h=Oe.get(h)||De;var b=u&&d;return function(e){var n=m;if(y&&e%1)return"";var i=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===s?"":s;if(g<0){var c=t.formatPrefix(e,p);e=c.scale(e),n=c.symbol+m}else e*=g;var _,w,T=(e=h(e,p)).lastIndexOf(".");if(T<0){var k=x?e.lastIndexOf("e"):-1;k<0?(_=e,w=""):(_=e.substring(0,k),w=e.substring(k))}else _=e.substring(0,T),w=r+e.substring(T+1);!u&&d&&(_=o(_,1/0));var M=v.length+_.length+w.length+(b?0:i.length),A=M<f?new Array(M=f-M+1).join(a):"";return b&&(_=o(A+_,A.length?f-w.length:1/0)),i+=v,e=_+w,("<"===l?i+e+A:">"===l?A+i+e:"^"===l?A.substring(0,M>>=1)+i+e+A.substring(M):i+(b?e:A+e))+n}}}t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Ae(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Le[8+n/3]};var Ce=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Oe=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Ae(e,r))).toFixed(Math.max(0,Math.min(20,Ae(e*(1+1e-15),r))))}});function De(t){return t+""}var ze=t.time={},Pe=Date;function Ee(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Ee.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(){Ie.setUTCDate.apply(this._,arguments)},setDay:function(){Ie.setUTCDay.apply(this._,arguments)},setFullYear:function(){Ie.setUTCFullYear.apply(this._,arguments)},setHours:function(){Ie.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Ie.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Ie.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Ie.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Ie.setUTCSeconds.apply(this._,arguments)},setTime:function(){Ie.setTime.apply(this._,arguments)}};var Ie=Date.prototype;function Re(t,e,r){function n(e){var r=t(e),n=i(r,1);return e-r<n-e?r:n}function a(r){return e(r=t(new Pe(r-1)),1),r}function i(t,r){return e(t=new Pe(+t),r),t}function o(t,n,i){var o=a(t),l=[];if(i>1)for(;o<n;)r(o)%i||l.push(new Date(+o)),e(o,1);else for(;o<n;)l.push(new Date(+o)),e(o,1);return l}t.floor=t,t.round=n,t.ceil=a,t.offset=i,t.range=o;var l=t.utc=Fe(t);return l.floor=l,l.round=Fe(n),l.ceil=Fe(a),l.offset=Fe(i),l.range=function(t,e,r){try{Pe=Ee;var n=new Ee;return n._=t,o(n,e,r)}finally{Pe=Date}},t}function Fe(t){return function(e,r){try{Pe=Ee;var n=new Ee;return n._=e,t(n,r)._}finally{Pe=Date}}}function Ne(e){var r=e.dateTime,n=e.date,a=e.time,i=e.periods,o=e.days,l=e.shortDays,s=e.months,c=e.shortMonths;function u(t){var e=t.length;function r(r){for(var n,a,i,o=[],l=-1,s=0;++l<e;)37===t.charCodeAt(l)&&(o.push(t.slice(s,l)),null!=(a=Be[n=t.charAt(++l)])&&(n=t.charAt(++l)),(i=_[n])&&(n=i(r,null==a?"e"===n?" ":"0":a)),o.push(n),s=l+1);return o.push(t.slice(s,l)),o.join("")}return r.parse=function(e){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(f(r,t,e,0)!=e.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var n=null!=r.Z&&Pe!==Ee,a=new(n?Ee:Pe);return"j"in r?a.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),a.setFullYear(r.y,0,1),a.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(a.getDay()+5)%7:r.w+7*r.U-(a.getDay()+6)%7)):a.setFullYear(r.y,r.m,r.d),a.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),n?a._:a},r.toString=function(){return t},r}function f(t,e,r,n){for(var a,i,o,l=0,s=e.length,c=r.length;l<s;){if(n>=c)return-1;if(37===(a=e.charCodeAt(l++))){if(o=e.charAt(l++),!(i=w[o in Be?e.charAt(l++):o])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}u.utc=function(t){var e=u(t);function r(t){try{var r=new(Pe=Ee);return r._=t,e(r)}finally{Pe=Date}}return r.parse=function(t){try{Pe=Ee;var r=e.parse(t);return r&&r._}finally{Pe=Date}},r.toString=e.toString,r},u.multi=u.utc.multi=or;var d=t.map(),p=Ve(o),h=qe(o),g=Ve(l),v=qe(l),m=Ve(s),y=qe(s),x=Ve(c),b=qe(c);i.forEach((function(t,e){d.set(t.toLowerCase(),e)}));var _={a:function(t){return l[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:u(r),d:function(t,e){return Ue(t.getDate(),e,2)},e:function(t,e){return Ue(t.getDate(),e,2)},H:function(t,e){return Ue(t.getHours(),e,2)},I:function(t,e){return Ue(t.getHours()%12||12,e,2)},j:function(t,e){return Ue(1+ze.dayOfYear(t),e,3)},L:function(t,e){return Ue(t.getMilliseconds(),e,3)},m:function(t,e){return Ue(t.getMonth()+1,e,2)},M:function(t,e){return Ue(t.getMinutes(),e,2)},p:function(t){return i[+(t.getHours()>=12)]},S:function(t,e){return Ue(t.getSeconds(),e,2)},U:function(t,e){return Ue(ze.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ue(ze.mondayOfYear(t),e,2)},x:u(n),X:u(a),y:function(t,e){return Ue(t.getFullYear()%100,e,2)},Y:function(t,e){return Ue(t.getFullYear()%1e4,e,4)},Z:ar,"%":function(){return"%"}},w={a:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.w=v.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){p.lastIndex=0;var n=p.exec(e.slice(r));return n?(t.w=h.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){m.lastIndex=0;var n=m.exec(e.slice(r));return n?(t.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return f(t,_.c.toString(),e,r)},d:$e,e:$e,H:tr,I:tr,j:Ke,L:nr,m:Je,M:er,p:function(t,e,r){var n=d.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:rr,U:Ze,w:Ge,W:Ye,x:function(t,e,r){return f(t,_.x.toString(),e,r)},X:function(t,e,r){return f(t,_.X.toString(),e,r)},y:We,Y:Xe,Z:Qe,"%":ir};return u}ze.year=Re((function(t){return(t=ze.day(t)).setMonth(0,1),t}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t){return t.getFullYear()})),ze.years=ze.year.range,ze.years.utc=ze.year.utc.range,ze.day=Re((function(t){var e=new Pe(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t){return t.getDate()-1})),ze.days=ze.day.range,ze.days.utc=ze.day.utc.range,ze.dayOfYear=function(t){var e=ze.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach((function(t,e){e=7-e;var r=ze[t]=Re((function(t){return(t=ze.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t}),(function(t,e){t.setDate(t.getDate()+7*Math.floor(e))}),(function(t){var r=ze.year(t).getDay();return Math.floor((ze.dayOfYear(t)+(r+e)%7)/7)-(r!==e)}));ze[t+"s"]=r.range,ze[t+"s"].utc=r.utc.range,ze[t+"OfYear"]=function(t){var r=ze.year(t).getDay();return Math.floor((ze.dayOfYear(t)+(r+e)%7)/7)}})),ze.week=ze.sunday,ze.weeks=ze.sunday.range,ze.weeks.utc=ze.sunday.utc.range,ze.weekOfYear=ze.sundayOfYear;var Be={"-":"",_:" ",0:"0"},He=/^\s*\d+/,je=/^%/;function Ue(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(e)+a:a)}function Ve(e){return new RegExp("^(?:"+e.map(t.requote).join("|")+")","i")}function qe(t){for(var e=new _,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Ge(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Ze(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function Ye(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Xe(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function We(t,e,r){He.lastIndex=0;var n,a=He.exec(e.slice(r,r+2));return a?(t.y=(n=+a[0])+(n>68?1900:2e3),r+a[0].length):-1}function Qe(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Je(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function $e(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Ke(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function tr(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function er(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function rr(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function nr(t,e,r){He.lastIndex=0;var n=He.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function ar(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=y(e)/60|0,a=y(e)%60;return r+Ue(n,"0",2)+Ue(a,"0",2)}function ir(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function or(t){for(var e=t.length,r=-1;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}t.locale=function(t){return{numberFormat:Se(t),timeFormat:Ne(t)}};var lr=t.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function sr(){}t.format=lr.numberFormat,t.geo={},sr.prototype={s:0,t:0,add:function(t){ur(t,this.t,cr),ur(cr.s,this.s,this),this.s?this.t+=cr.t:this.s=cr.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var cr=new sr;function ur(t,e,r){var n=r.s=t+e,a=n-t,i=n-a;r.t=t-i+(e-a)}function fr(t,e){t&&pr.hasOwnProperty(t.type)&&pr[t.type](t,e)}t.geo.stream=function(t,e){t&&dr.hasOwnProperty(t.type)?dr[t.type](t,e):fr(t,e)};var dr={Feature:function(t,e){fr(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,a=r.length;++n<a;)fr(r[n].geometry,e)}},pr={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){hr(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)hr(r[n],e,0)},Polygon:function(t,e){gr(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)gr(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,a=r.length;++n<a;)fr(r[n],e)}};function hr(t,e,r){var n,a=-1,i=t.length-r;for(e.lineStart();++a<i;)n=t[a],e.point(n[0],n[1],n[2]);e.lineEnd()}function gr(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)hr(t[r],e,1);e.polygonEnd()}t.geo.area=function(e){return vr=0,t.geo.stream(e,Cr),vr};var vr,mr,yr,xr,br,_r,wr,Tr,kr,Mr,Ar,Lr,Sr=new sr,Cr={sphere:function(){vr+=4*At},point:E,lineStart:E,lineEnd:E,polygonStart:function(){Sr.reset(),Cr.lineStart=Or},polygonEnd:function(){var t=2*Sr;vr+=t<0?4*At+t:t,Cr.lineStart=Cr.lineEnd=Cr.point=E}};function Or(){var t,e,r,n,a;function i(t,e){e=e*Ot/2+At/4;var i=(t*=Ot)-r,o=i>=0?1:-1,l=o*i,s=Math.cos(e),c=Math.sin(e),u=a*c,f=n*s+u*Math.cos(l),d=u*o*Math.sin(l);Sr.add(Math.atan2(d,f)),r=t,n=s,a=c}Cr.point=function(o,l){Cr.point=i,r=(t=o)*Ot,n=Math.cos(l=(e=l)*Ot/2+At/4),a=Math.sin(l)},Cr.lineEnd=function(){i(t,e)}}function Dr(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function zr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Pr(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Er(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Ir(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Rr(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Fr(t){return[Math.atan2(t[1],t[0]),It(t[2])]}function Nr(t,e){return y(t[0]-e[0])<kt&&y(t[1]-e[1])<kt}t.geo.bounds=function(){var e,r,n,a,i,o,l,s,c,u,f,d={point:p,lineStart:g,lineEnd:v,polygonStart:function(){d.point=m,d.lineStart=x,d.lineEnd=b,c=0,Cr.polygonStart()},polygonEnd:function(){Cr.polygonEnd(),d.point=p,d.lineStart=g,d.lineEnd=v,Sr<0?(e=-(n=180),r=-(a=90)):c>kt?a=90:c<-kt&&(r=-90),f[0]=e,f[1]=n}};function p(t,i){u.push(f=[e=t,n=t]),i<r&&(r=i),i>a&&(a=i)}function h(t,o){var l=Dr([t*Ot,o*Ot]);if(s){var c=Pr(s,l),u=Pr([c[1],-c[0],0],c);Rr(u),u=Fr(u);var f=t-i,d=f>0?1:-1,h=u[0]*Dt*d,g=y(f)>180;if(g^(d*i<h&&h<d*t))(v=u[1]*Dt)>a&&(a=v);else if(g^(d*i<(h=(h+360)%360-180)&&h<d*t)){var v;(v=-u[1]*Dt)<r&&(r=v)}else o<r&&(r=o),o>a&&(a=o);g?t<i?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(t<e&&(e=t),t>n&&(n=t)):t>i?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t)}else p(t,o);s=l,i=t}function g(){d.point=h}function v(){f[0]=e,f[1]=n,d.point=p,s=null}function m(t,e){if(s){var r=t-i;c+=y(r)>180?r+(r>0?360:-360):r}else o=t,l=e;Cr.point(t,e),h(t,e)}function x(){Cr.lineStart()}function b(){m(o,l),Cr.lineEnd(),y(c)>kt&&(e=-(n=180)),f[0]=e,f[1]=n,s=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function T(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}return function(i){if(a=n=-(e=r=1/0),u=[],t.geo.stream(i,d),c=u.length){u.sort(w);for(var o=1,l=[g=u[0]];o<c;++o)T((p=u[o])[0],g)||T(p[1],g)?(_(g[0],p[1])>_(g[0],g[1])&&(g[1]=p[1]),_(p[0],g[1])>_(g[0],g[1])&&(g[0]=p[0])):l.push(g=p);for(var s,c,p,h=-1/0,g=(o=0,l[c=l.length-1]);o<=c;g=p,++o)p=l[o],(s=_(g[1],p[0]))>h&&(h=s,e=p[0],n=g[1])}return u=f=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,a]]}}(),t.geo.centroid=function(e){mr=yr=xr=br=_r=wr=Tr=kr=Mr=Ar=Lr=0,t.geo.stream(e,Br);var r=Mr,n=Ar,a=Lr,i=r*r+n*n+a*a;return i<Mt&&(r=wr,n=Tr,a=kr,yr<kt&&(r=xr,n=br,a=_r),(i=r*r+n*n+a*a)<Mt)?[NaN,NaN]:[Math.atan2(n,r)*Dt,It(a/Math.sqrt(i))*Dt]};var Br={sphere:E,point:Hr,lineStart:Ur,lineEnd:Vr,polygonStart:function(){Br.lineStart=qr},polygonEnd:function(){Br.lineStart=Ur}};function Hr(t,e){t*=Ot;var r=Math.cos(e*=Ot);jr(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function jr(t,e,r){++mr,xr+=(t-xr)/mr,br+=(e-br)/mr,_r+=(r-_r)/mr}function Ur(){var t,e,r;function n(n,a){n*=Ot;var i=Math.cos(a*=Ot),o=i*Math.cos(n),l=i*Math.sin(n),s=Math.sin(a),c=Math.atan2(Math.sqrt((c=e*s-r*l)*c+(c=r*o-t*s)*c+(c=t*l-e*o)*c),t*o+e*l+r*s);yr+=c,wr+=c*(t+(t=o)),Tr+=c*(e+(e=l)),kr+=c*(r+(r=s)),jr(t,e,r)}Br.point=function(a,i){a*=Ot;var o=Math.cos(i*=Ot);t=o*Math.cos(a),e=o*Math.sin(a),r=Math.sin(i),Br.point=n,jr(t,e,r)}}function Vr(){Br.point=Hr}function qr(){var t,e,r,n,a;function i(t,e){t*=Ot;var i=Math.cos(e*=Ot),o=i*Math.cos(t),l=i*Math.sin(t),s=Math.sin(e),c=n*s-a*l,u=a*o-r*s,f=r*l-n*o,d=Math.sqrt(c*c+u*u+f*f),p=r*o+n*l+a*s,h=d&&-Et(p)/d,g=Math.atan2(d,p);Mr+=h*c,Ar+=h*u,Lr+=h*f,yr+=g,wr+=g*(r+(r=o)),Tr+=g*(n+(n=l)),kr+=g*(a+(a=s)),jr(r,n,a)}Br.point=function(o,l){t=o,e=l,Br.point=i,o*=Ot;var s=Math.cos(l*=Ot);r=s*Math.cos(o),n=s*Math.sin(o),a=Math.sin(l),jr(r,n,a)},Br.lineEnd=function(){i(t,e),Br.lineEnd=Vr,Br.point=Hr}}function Gr(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return(r=e.invert(r,n))&&t.invert(r[0],r[1])}),r}function Zr(){return!0}function Yr(t,e,r,n,a){var i=[],o=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(Nr(r,n)){a.lineStart();for(var l=0;l<e;++l)a.point((r=t[l])[0],r[1]);a.lineEnd()}else{var s=new Wr(r,t,null,!0),c=new Wr(r,null,s,!1);s.o=c,i.push(s),o.push(c),s=new Wr(n,t,null,!1),c=new Wr(n,null,s,!0),s.o=c,i.push(s),o.push(c)}}})),o.sort(e),Xr(i),Xr(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 Xr(t){if(e=t.length){for(var e,r,n=0,a=t[0];++n<e;)a.n=r=t[n],r.p=a,a=r;a.n=r=t[0],r.p=a}}function Wr(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Qr(e,r,n,a){return function(i,o){var l,s=r(o),c=i.invert(a[0],a[1]),u={point:f,lineStart:p,lineEnd:h,polygonStart:function(){u.point=b,u.lineStart=_,u.lineEnd=w,l=[],g=[]},polygonEnd:function(){u.point=f,u.lineStart=p,u.lineEnd=h,l=t.merge(l);var e=function(t,e){var r=t[0],n=t[1],a=[Math.sin(r),-Math.cos(r),0],i=0,o=0;Sr.reset();for(var l=0,s=e.length;l<s;++l){var c=e[l],u=c.length;if(u)for(var f=c[0],d=f[0],p=f[1]/2+At/4,h=Math.sin(p),g=Math.cos(p),v=1;;){v===u&&(v=0);var m=(t=c[v])[0],y=t[1]/2+At/4,x=Math.sin(y),b=Math.cos(y),_=m-d,w=_>=0?1:-1,T=w*_,k=T>At,M=h*x;if(Sr.add(Math.atan2(M*w*Math.sin(T),g*b+M*Math.cos(T))),i+=k?_+w*Lt:_,k^d>=r^m>=r){var A=Pr(Dr(f),Dr(t));Rr(A);var L=Pr(a,A);Rr(L);var S=(k^_>=0?-1:1)*It(L[2]);(n>S||n===S&&(A[0]||A[1]))&&(o+=k^_>=0?1:-1)}if(!v++)break;d=m,h=x,g=b,f=t}}return(i<-kt||i<kt&&Sr<-kt)^1&o}(c,g);l.length?(x||(o.polygonStart(),x=!0),Yr(l,Kr,e,n,o)):e&&(x||(o.polygonStart(),x=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),x&&(o.polygonEnd(),x=!1),l=g=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function f(t,r){var n=i(t,r);e(t=n[0],r=n[1])&&o.point(t,r)}function d(t,e){var r=i(t,e);s.point(r[0],r[1])}function p(){u.point=d,s.lineStart()}function h(){u.point=f,s.lineEnd()}var g,v,m=$r(),y=r(m),x=!1;function b(t,e){v.push([t,e]);var r=i(t,e);y.point(r[0],r[1])}function _(){y.lineStart(),v=[]}function w(){b(v[0][0],v[0][1]),y.lineEnd();var t,e=y.clean(),r=m.buffer(),n=r.length;if(v.pop(),g.push(v),v=null,n)if(1&e){var a,i=-1;if((n=(t=r[0]).length-1)>0){for(x||(o.polygonStart(),x=!0),o.lineStart();++i<n;)o.point((a=t[i])[0],a[1]);o.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),l.push(r.filter(Jr))}return u}}function Jr(t){return t.length>1}function $r(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:E,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Kr(t,e){return((t=t.x)[0]<0?t[1]-Ct-kt:Ct-t[1])-((e=e.x)[0]<0?e[1]-Ct-kt:Ct-e[1])}var tn=Qr(Zr,(function(t){var e,r=NaN,n=NaN,a=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,o){var l=i>0?At:-At,s=y(i-r);y(s-At)<kt?(t.point(r,n=(n+o)/2>0?Ct:-Ct),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),t.point(i,n),e=0):a!==l&&s>=At&&(y(r-a)<kt&&(r-=a*kt),y(i-l)<kt&&(i-=l*kt),n=function(t,e,r,n){var a,i,o=Math.sin(t-r);return y(o)>kt?Math.atan((Math.sin(e)*(i=Math.cos(n))*Math.sin(r)-Math.sin(n)*(a=Math.cos(e))*Math.sin(t))/(a*i*o)):(e+n)/2}(r,n,i,o),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),e=0),t.point(r=i,n=o),a=l},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var a;if(null==t)a=r*Ct,n.point(-At,a),n.point(0,a),n.point(At,a),n.point(At,0),n.point(At,-a),n.point(0,-a),n.point(-At,-a),n.point(-At,0),n.point(-At,a);else if(y(t[0]-e[0])>kt){var i=t[0]<e[0]?At:-At;a=r*i/2,n.point(-i,a),n.point(0,a),n.point(i,a)}else n.point(e[0],e[1])}),[-At,-At/2]);function en(t){var e=Math.cos(t),r=e>0,n=y(e)>kt;return Qr(a,(function(t){var e,l,s,c,u;return{lineStart:function(){c=s=!1,u=1},point:function(f,d){var p,h=[f,d],g=a(f,d),v=r?g?0:o(f,d):g?o(f+(f<0?At:-At),d):0;if(!e&&(c=s=g)&&t.lineStart(),g!==s&&(p=i(e,h),(Nr(e,p)||Nr(h,p))&&(h[0]+=kt,h[1]+=kt,g=a(h[0],h[1]))),g!==s)u=0,g?(t.lineStart(),p=i(h,e),t.point(p[0],p[1])):(p=i(e,h),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(n&&e&&r^g){var m;v&l||!(m=i(h,e,!0))||(u=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!g||e&&Nr(e,h)||t.point(h[0],h[1]),e=h,s=g,l=v},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return u|(c&&s)<<1}}}),Nn(t,6*Ot),r?[0,-t]:[-At,t-At]);function a(t,r){return Math.cos(t)*Math.cos(r)>e}function i(t,r,n){var a=[1,0,0],i=Pr(Dr(t),Dr(r)),o=zr(i,i),l=i[0],s=o-l*l;if(!s)return!n&&t;var c=e*o/s,u=-e*l/s,f=Pr(a,i),d=Ir(a,c);Er(d,Ir(i,u));var p=f,h=zr(d,p),g=zr(p,p),v=h*h-g*(zr(d,d)-1);if(!(v<0)){var m=Math.sqrt(v),x=Ir(p,(-h-m)/g);if(Er(x,d),x=Fr(x),!n)return x;var b,_=t[0],w=r[0],T=t[1],k=r[1];w<_&&(b=_,_=w,w=b);var M=w-_,A=y(M-At)<kt;if(!A&&k<T&&(b=T,T=k,k=b),A||M<kt?A?T+k>0^x[1]<(y(x[0]-_)<kt?T:k):T<=x[1]&&x[1]<=k:M>At^(_<=x[0]&&x[0]<=w)){var L=Ir(p,(-h+m)/g);return Er(L,d),[x,Fr(L)]}}}function o(e,n){var a=r?t:At-t,i=0;return e<-a?i|=1:e>a&&(i|=2),n<-a?i|=4:n>a&&(i|=8),i}}function rn(t,e,r,n){return function(a){var i,o=a.a,l=a.b,s=o.x,c=o.y,u=0,f=1,d=l.x-s,p=l.y-c;if(i=t-s,d||!(i>0)){if(i/=d,d<0){if(i<u)return;i<f&&(f=i)}else if(d>0){if(i>f)return;i>u&&(u=i)}if(i=r-s,d||!(i<0)){if(i/=d,d<0){if(i>f)return;i>u&&(u=i)}else if(d>0){if(i<u)return;i<f&&(f=i)}if(i=e-c,p||!(i>0)){if(i/=p,p<0){if(i<u)return;i<f&&(f=i)}else if(p>0){if(i>f)return;i>u&&(u=i)}if(i=n-c,p||!(i<0)){if(i/=p,p<0){if(i>f)return;i>u&&(u=i)}else if(p>0){if(i<u)return;i<f&&(f=i)}return u>0&&(a.a={x:s+u*d,y:c+u*p}),f<1&&(a.b={x:s+f*d,y:c+f*p}),a}}}}}}function nn(e,r,n,a){return function(s){var c,u,f,d,p,h,g,v,m,y,x,b=s,_=$r(),w=rn(e,r,n,a),T={point:A,lineStart:function(){T.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()));T.point=A,m&&s.lineEnd()},polygonStart:function(){s=_,c=[],u=[],x=!0},polygonEnd:function(){s=b,c=t.merge(c);var r=function(t){for(var e=0,r=u.length,n=t[1],a=0;a<r;++a)for(var i,o=1,l=u[a],s=l.length,c=l[0];o<s;++o)i=l[o],c[1]<=n?i[1]>n&&Pt(c,i,t)>0&&++e:i[1]<=n&&Pt(c,i,t)<0&&--e,c=i;return 0!==e}([e,a]),n=x&&r,i=c.length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),k(null,null,1,s),s.lineEnd()),i&&Yr(c,o,r,k,s),s.polygonEnd()),c=u=f=null}};function k(t,o,s,c){var u=0,f=0;if(null==t||(u=i(t,s))!==(f=i(o,s))||l(t,o)<0^s>0)do{c.point(0===u||3===u?e:n,u>1?a:r)}while((u=(u+s+4)%4)!==f);else c.point(o[0],o[1])}function M(t,i){return e<=t&&t<=n&&r<=i&&i<=a}function A(t,e){M(t,e)&&s.point(t,e)}function L(t,e){var r=M(t=Math.max(-1e9,Math.min(1e9,t)),e=Math.max(-1e9,Math.min(1e9,e)));if(u&&f.push([t,e]),y)d=t,p=e,h=r,y=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&m)s.point(t,e);else{var n={a:{x:g,y:v},b:{x:t,y:e}};w(n)?(m||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),x=!1):r&&(s.lineStart(),s.point(t,e),x=!1)}g=t,v=e,m=r}return T};function i(t,a){return y(t[0]-e)<kt?a>0?0:3:y(t[0]-n)<kt?a>0?2:1:y(t[1]-r)<kt?a>0?1:0:a>0?3:2}function o(t,e){return l(t.x,e.x)}function l(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}}function an(t){var e=0,r=At/3,n=On(t),a=n(e,r);return a.parallels=function(t){return arguments.length?n(e=t[0]*At/180,r=t[1]*At/180):[e/At*180,r/At*180]},a}function on(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,a=1+r*(2*n-r),i=Math.sqrt(a)/n;function o(t,e){var r=Math.sqrt(a-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),i-r*Math.cos(t)]}return o.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/n,It((a-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,a,i,o={stream:function(t){return a&&(a.valid=!1),(a=i(t)).valid=!0,a},extent:function(l){return arguments.length?(i=nn(t=+l[0][0],e=+l[0][1],r=+l[1][0],n=+l[1][1]),a&&(a.valid=!1,a=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return an(on)}).raw=on,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,r,n,a,i=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,r){e=[t,r]}};function c(t){var i=t[0],o=t[1];return e=null,r(i,o),e||(n(i,o),e)||a(i,o),e}return c.invert=function(t){var e=i.scale(),r=i.translate(),n=(t[0]-r[0])/e,a=(t[1]-r[1])/e;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?o:a>=.166&&a<.234&&n>=-.214&&n<-.115?l:i).invert(t)},c.stream=function(t){var e=i.stream(t),r=o.stream(t),n=l.stream(t);return{point:function(t,a){e.point(t,a),r.point(t,a),n.point(t,a)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},c.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),l.precision(t),c):i.precision()},c.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),l.scale(t),c.translate(i.translate())):i.scale()},c.translate=function(t){if(!arguments.length)return i.translate();var e=i.scale(),u=+t[0],f=+t[1];return r=i.translate(t).clipExtent([[u-.455*e,f-.238*e],[u+.455*e,f+.238*e]]).stream(s).point,n=o.translate([u-.307*e,f+.201*e]).clipExtent([[u-.425*e+kt,f+.12*e+kt],[u-.214*e-kt,f+.234*e-kt]]).stream(s).point,a=l.translate([u-.205*e,f+.212*e]).clipExtent([[u-.214*e+kt,f+.166*e+kt],[u-.115*e-kt,f+.234*e-kt]]).stream(s).point,c},c.scale(1070)};var ln,sn,cn,un,fn,dn,pn={point:E,lineStart:E,lineEnd:E,polygonStart:function(){sn=0,pn.lineStart=hn},polygonEnd:function(){pn.lineStart=pn.lineEnd=pn.point=E,ln+=y(sn/2)}};function hn(){var t,e,r,n;function a(t,e){sn+=n*t-r*e,r=t,n=e}pn.point=function(i,o){pn.point=a,t=r=i,e=n=o},pn.lineEnd=function(){a(t,e)}}var gn={point:function(t,e){t<cn&&(cn=t);t>fn&&(fn=t);e<un&&(un=e);e>dn&&(dn=e)},lineStart:E,lineEnd:E,polygonStart:E,polygonEnd:E};function vn(){var t=mn(4.5),e=[],r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=l},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=mn(e),r},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function n(r,n){e.push("M",r,",",n,t)}function a(t,n){e.push("M",t,",",n),r.point=i}function i(t,r){e.push("L",t,",",r)}function o(){r.point=n}function l(){e.push("Z")}return r}function mn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var yn,xn={point:bn,lineStart:_n,lineEnd:wn,polygonStart:function(){xn.lineStart=Tn},polygonEnd:function(){xn.point=bn,xn.lineStart=_n,xn.lineEnd=wn}};function bn(t,e){xr+=t,br+=e,++_r}function _n(){var t,e;function r(r,n){var a=r-t,i=n-e,o=Math.sqrt(a*a+i*i);wr+=o*(t+r)/2,Tr+=o*(e+n)/2,kr+=o,bn(t=r,e=n)}xn.point=function(n,a){xn.point=r,bn(t=n,e=a)}}function wn(){xn.point=bn}function Tn(){var t,e,r,n;function a(t,e){var a=t-r,i=e-n,o=Math.sqrt(a*a+i*i);wr+=o*(r+t)/2,Tr+=o*(n+e)/2,kr+=o,Mr+=(o=n*t-r*e)*(r+t),Ar+=o*(n+e),Lr+=3*o,bn(r=t,n=e)}xn.point=function(i,o){xn.point=a,bn(t=r=i,e=n=o)},xn.lineEnd=function(){a(t,e)}}function kn(t){var e=4.5,r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=l},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:E};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,Lt)}function a(e,n){t.moveTo(e,n),r.point=i}function i(e,r){t.lineTo(e,r)}function o(){r.point=n}function l(){t.closePath()}return r}function Mn(t){var e=.5,r=Math.cos(30*Ot),n=16;function a(t){return(n?o:i)(t)}function i(e){return Sn(e,(function(r,n){r=t(r,n),e.point(r[0],r[1])}))}function o(e){var r,a,i,o,s,c,u,f,d,p,h,g,v={point:m,lineStart:y,lineEnd:b,polygonStart:function(){e.polygonStart(),v.lineStart=_},polygonEnd:function(){e.polygonEnd(),v.lineStart=y}};function m(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){f=NaN,v.point=x,e.lineStart()}function x(r,a){var i=Dr([r,a]),o=t(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,e),e.point(f,d)}function b(){v.point=m,e.lineEnd()}function _(){y(),v.point=w,v.lineEnd=T}function w(t,e){x(r=t,e),a=f,i=d,o=p,s=h,c=g,v.point=x}function T(){l(f,d,u,p,h,g,a,i,r,o,s,c,n,e),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*e&&v--){var w=o+p,T=s+h,k=c+g,M=Math.sqrt(w*w+T*T+k*k),A=Math.asin(k/=M),L=y(y(k)-1)<kt||y(i-d)<kt?(i+d)/2:Math.atan2(T,w),S=t(L,A),C=S[0],O=S[1],D=C-n,z=O-a,P=b*D-x*z;(P*P/_>e||y((x*D+b*z)/_-.5)>.3||o*p+s*h+c*g<r)&&(l(n,a,i,o,s,c,C,O,L,w/=M,T/=M,k,v,m),m.point(C,O),l(C,O,L,w,T,k,u,f,d,p,h,g,v,m))}}return a.precision=function(t){return arguments.length?(n=(e=t*t)>0&&16,a):Math.sqrt(e)},a}function An(t){var e=Mn((function(e,r){return t([e*Dt,r*Dt])}));return function(t){return Dn(e(t))}}function Ln(t){this.stream=t}function Sn(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Cn(t){return On((function(){return t}))()}function On(e){var r,n,a,i,o,l,s=Mn((function(t,e){return[(t=r(t,e))[0]*c+i,o-t[1]*c]})),c=150,u=480,f=250,d=0,p=0,h=0,g=0,v=0,m=tn,y=O,x=null,b=null;function _(t){return[(t=a(t[0]*Ot,t[1]*Ot))[0]*c+i,o-t[1]*c]}function w(t){return(t=a.invert((t[0]-i)/c,(o-t[1])/c))&&[t[0]*Dt,t[1]*Dt]}function T(){a=Gr(n=En(h,g,v),r);var t=r(d,p);return i=u-t[0]*c,o=f+t[1]*c,k()}function k(){return l&&(l.valid=!1,l=null),_}return _.stream=function(t){return l&&(l.valid=!1),(l=Dn(m(n,s(y(t))))).valid=!0,l},_.clipAngle=function(t){return arguments.length?(m=null==t?(x=t,tn):en((x=+t)*Ot),k()):x},_.clipExtent=function(t){return arguments.length?(b=t,y=t?nn(t[0][0],t[0][1],t[1][0],t[1][1]):O,k()):b},_.scale=function(t){return arguments.length?(c=+t,T()):c},_.translate=function(t){return arguments.length?(u=+t[0],f=+t[1],T()):[u,f]},_.center=function(t){return arguments.length?(d=t[0]%360*Ot,p=t[1]%360*Ot,T()):[d*Dt,p*Dt]},_.rotate=function(t){return arguments.length?(h=t[0]%360*Ot,g=t[1]%360*Ot,v=t.length>2?t[2]%360*Ot:0,T()):[h*Dt,g*Dt,v*Dt]},t.rebind(_,s,"precision"),function(){return r=e.apply(this,arguments),_.invert=r.invert&&w,T()}}function Dn(t){return Sn(t,(function(e,r){t.point(e*Ot,r*Ot)}))}function zn(t,e){return[t,e]}function Pn(t,e){return[t>At?t-Lt:t<-At?t+Lt:t,e]}function En(t,e,r){return t?e||r?Gr(Rn(t),Fn(e,r)):Rn(t):e||r?Fn(e,r):Pn}function In(t){return function(e,r){return[(e+=t)>At?e-Lt:e<-At?e+Lt:e,r]}}function Rn(t){var e=In(t);return e.invert=In(-t),e}function Fn(t,e){var r=Math.cos(t),n=Math.sin(t),a=Math.cos(e),i=Math.sin(e);function o(t,e){var o=Math.cos(e),l=Math.cos(t)*o,s=Math.sin(t)*o,c=Math.sin(e),u=c*r+l*n;return[Math.atan2(s*a-u*i,l*r-c*n),It(u*a+s*i)]}return o.invert=function(t,e){var o=Math.cos(e),l=Math.cos(t)*o,s=Math.sin(t)*o,c=Math.sin(e),u=c*a-s*i;return[Math.atan2(s*a+c*i,l*r+u*n),It(u*r-l*n)]},o}function Nn(t,e){var r=Math.cos(t),n=Math.sin(t);return function(a,i,o,l){var s=o*e;null!=a?(a=Bn(r,a),i=Bn(r,i),(o>0?a<i:a>i)&&(a+=o*Lt)):(a=t+o*Lt,i=t-.5*s);for(var c,u=a;o>0?u>i:u<i;u-=s)l.point((c=Fr([r,-n*Math.cos(u),-n*Math.sin(u)]))[0],c[1])}}function Bn(t,e){var r=Dr(e);r[0]-=t,Rr(r);var n=Et(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-kt)%(2*Math.PI)}function Hn(e,r,n){var a=t.range(e,r-kt,n).concat(r);return function(t){return a.map((function(e){return[t,e]}))}}function jn(e,r,n){var a=t.range(e,r-kt,n).concat(r);return function(t){return a.map((function(e){return[e,t]}))}}function Un(t){return t.source}function Vn(t){return t.target}t.geo.path=function(){var e,r,n,a,i,o=4.5;function l(e){return e&&("function"==typeof o&&a.pointRadius(+o.apply(this,arguments)),i&&i.valid||(i=n(a)),t.geo.stream(e,i)),a.result()}function s(){return i=null,l}return l.area=function(e){return ln=0,t.geo.stream(e,n(pn)),ln},l.centroid=function(e){return xr=br=_r=wr=Tr=kr=Mr=Ar=Lr=0,t.geo.stream(e,n(xn)),Lr?[Mr/Lr,Ar/Lr]:kr?[wr/kr,Tr/kr]:_r?[xr/_r,br/_r]:[NaN,NaN]},l.bounds=function(e){return fn=dn=-(cn=un=1/0),t.geo.stream(e,n(gn)),[[cn,un],[fn,dn]]},l.projection=function(t){return arguments.length?(n=(e=t)?t.stream||An(t):O,s()):e},l.context=function(t){return arguments.length?(a=null==(r=t)?new vn:new kn(t),"function"!=typeof o&&a.pointRadius(o),s()):r},l.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(a.pointRadius(+t),+t),l):o},l.projection(t.geo.albersUsa()).context(null)},t.geo.transform=function(t){return{stream:function(e){var r=new Ln(e);for(var n in t)r[n]=t[n];return r}}},Ln.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},t.geo.projection=Cn,t.geo.projectionMutator=On,(t.geo.equirectangular=function(){return Cn(zn)}).raw=zn.invert=zn,t.geo.rotation=function(t){function e(e){return(e=t(e[0]*Ot,e[1]*Ot))[0]*=Dt,e[1]*=Dt,e}return t=En(t[0]%360*Ot,t[1]*Ot,t.length>2?t[2]*Ot:0),e.invert=function(e){return(e=t.invert(e[0]*Ot,e[1]*Ot))[0]*=Dt,e[1]*=Dt,e},e},Pn.invert=zn,t.geo.circle=function(){var t,e,r=[0,0],n=6;function a(){var t="function"==typeof r?r.apply(this,arguments):r,n=En(-t[0]*Ot,-t[1]*Ot,0).invert,a=[];return e(null,null,1,{point:function(t,e){a.push(t=n(t,e)),t[0]*=Dt,t[1]*=Dt}}),{type:"Polygon",coordinates:[a]}}return a.origin=function(t){return arguments.length?(r=t,a):r},a.angle=function(r){return arguments.length?(e=Nn((t=+r)*Ot,n*Ot),a):t},a.precision=function(r){return arguments.length?(e=Nn(t*Ot,(n=+r)*Ot),a):n},a.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Ot,a=t[1]*Ot,i=e[1]*Ot,o=Math.sin(n),l=Math.cos(n),s=Math.sin(a),c=Math.cos(a),u=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((r=f*o)*r+(r=c*u-s*f*l)*r),s*u+c*f*l)},t.geo.graticule=function(){var e,r,n,a,i,o,l,s,c,u,f,d,p=10,h=p,g=90,v=360,m=2.5;function x(){return{type:"MultiLineString",coordinates:b()}}function b(){return t.range(Math.ceil(a/g)*g,n,g).map(f).concat(t.range(Math.ceil(s/v)*v,l,v).map(d)).concat(t.range(Math.ceil(r/p)*p,e,p).filter((function(t){return y(t%g)>kt})).map(c)).concat(t.range(Math.ceil(o/h)*h,i,h).filter((function(t){return y(t%v)>kt})).map(u))}return x.lines=function(){return b().map((function(t){return{type:"LineString",coordinates:t}}))},x.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(n).reverse().slice(1),d(s).reverse().slice(1))]}},x.extent=function(t){return arguments.length?x.majorExtent(t).minorExtent(t):x.minorExtent()},x.majorExtent=function(t){return arguments.length?(a=+t[0][0],n=+t[1][0],s=+t[0][1],l=+t[1][1],a>n&&(t=a,a=n,n=t),s>l&&(t=s,s=l,l=t),x.precision(m)):[[a,s],[n,l]]},x.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],i=+t[1][1],r>e&&(t=r,r=e,e=t),o>i&&(t=o,o=i,i=t),x.precision(m)):[[r,o],[e,i]]},x.step=function(t){return arguments.length?x.majorStep(t).minorStep(t):x.minorStep()},x.majorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],x):[g,v]},x.minorStep=function(t){return arguments.length?(p=+t[0],h=+t[1],x):[p,h]},x.precision=function(t){return arguments.length?(m=+t,c=Hn(o,i,90),u=jn(r,e,m),f=Hn(s,l,90),d=jn(a,n,m),x):m},x.majorExtent([[-180,-90+kt],[180,90-kt]]).minorExtent([[-180,-80-kt],[180,80+kt]])},t.geo.greatArc=function(){var e,r,n=Un,a=Vn;function i(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||a.apply(this,arguments)]}}return i.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||a.apply(this,arguments))},i.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,i):n},i.target=function(t){return arguments.length?(a=t,r="function"==typeof t?null:t,i):a},i.precision=function(){return arguments.length?i:0},i},t.geo.interpolate=function(t,e){return r=t[0]*Ot,n=t[1]*Ot,a=e[0]*Ot,i=e[1]*Ot,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(Ft(i-n)+o*s*Ft(a-r))),g=1/Math.sin(h),(v=h?function(t){var e=Math.sin(t*=h)*g,r=Math.sin(h-t)*g,n=r*u+e*d,a=r*f+e*p,i=r*l+e*c;return[Math.atan2(a,n)*Dt,Math.atan2(i,Math.sqrt(n*n+a*a))*Dt]}:function(){return[r*Dt,n*Dt]}).distance=h,v;var r,n,a,i,o,l,s,c,u,f,d,p,h,g,v},t.geo.length=function(e){return yn=0,t.geo.stream(e,qn),yn};var qn={sphere:E,point:E,lineStart:function(){var t,e,r;function n(n,a){var i=Math.sin(a*=Ot),o=Math.cos(a),l=y((n*=Ot)-t),s=Math.cos(l);yn+=Math.atan2(Math.sqrt((l=o*Math.sin(l))*l+(l=r*i-e*o*s)*l),e*i+r*o*s),t=n,e=i,r=o}qn.point=function(a,i){t=a*Ot,e=Math.sin(i*=Ot),r=Math.cos(i),qn.point=n},qn.lineEnd=function(){qn.point=qn.lineEnd=E}},lineEnd:E,polygonStart:E,polygonEnd:E};function Gn(t,e){function r(e,r){var n=Math.cos(e),a=Math.cos(r),i=t(n*a);return[i*a*Math.sin(e),i*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),a=e(n),i=Math.sin(a),o=Math.cos(a);return[Math.atan2(t*i,n*o),Math.asin(n&&r*i/n)]},r}var Zn=Gn((function(t){return Math.sqrt(2/(1+t))}),(function(t){return 2*Math.asin(t/2)}));(t.geo.azimuthalEqualArea=function(){return Cn(Zn)}).raw=Zn;var Yn=Gn((function(t){var e=Math.acos(t);return e&&e/Math.sin(e)}),O);function Xn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(At/4+t/2)},a=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),i=r*Math.pow(n(t),a)/a;if(!a)return Jn;function o(t,e){i>0?e<-Ct+kt&&(e=-Ct+kt):e>Ct-kt&&(e=Ct-kt);var r=i/Math.pow(n(e),a);return[r*Math.sin(a*t),i-r*Math.cos(a*t)]}return o.invert=function(t,e){var r=i-e,n=zt(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(i/n,1/a))-Ct]},o}function Wn(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),a=r/n+t;if(y(n)<kt)return zn;function i(t,e){var r=a-e;return[r*Math.sin(n*t),a-r*Math.cos(n*t)]}return i.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/n,a-zt(n)*Math.sqrt(t*t+r*r)]},i}(t.geo.azimuthalEquidistant=function(){return Cn(Yn)}).raw=Yn,(t.geo.conicConformal=function(){return an(Xn)}).raw=Xn,(t.geo.conicEquidistant=function(){return an(Wn)}).raw=Wn;var Qn=Gn((function(t){return 1/t}),Math.atan);function Jn(t,e){return[t,Math.log(Math.tan(At/4+e/2))]}function $n(t){var e,r=Cn(t),n=r.scale,a=r.translate,i=r.clipExtent;return r.scale=function(){var t=n.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.translate=function(){var t=a.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var o=i.apply(r,arguments);if(o===r){if(e=null==t){var l=At*n(),s=a();i([[s[0]-l,s[1]-l],[s[0]+l,s[1]+l]])}}else e&&(o=null);return o},r.clipExtent(null)}(t.geo.gnomonic=function(){return Cn(Qn)}).raw=Qn,Jn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Ct]},(t.geo.mercator=function(){return $n(Jn)}).raw=Jn;var Kn=Gn((function(){return 1}),Math.asin);(t.geo.orthographic=function(){return Cn(Kn)}).raw=Kn;var ta=Gn((function(t){return 1/(1+t)}),(function(t){return 2*Math.atan(t)}));function ea(t,e){return[Math.log(Math.tan(At/4+e/2)),-t]}function ra(t){return t[0]}function na(t){return t[1]}function aa(t){for(var e=t.length,r=[0,1],n=2,a=2;a<e;a++){for(;n>1&&Pt(t[r[n-2]],t[r[n-1]],t[a])<=0;)--n;r[n++]=a}return r.slice(0,n)}function ia(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Cn(ta)}).raw=ta,ea.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Ct]},(t.geo.transverseMercator=function(){var t=$n(ea),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90])}).raw=ea,t.geom={},t.geom.hull=function(t){var e=ra,r=na;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,a=he(e),i=he(r),o=t.length,l=[],s=[];for(n=0;n<o;n++)l.push([+a.call(this,t[n],n),+i.call(this,t[n],n),n]);for(l.sort(ia),n=0;n<o;n++)s.push([l[n][0],-l[n][1]]);var c=aa(l),u=aa(s),f=u[0]===c[0],d=u[u.length-1]===c[c.length-1],p=[];for(n=c.length-1;n>=0;--n)p.push(t[l[c[n]][2]]);for(n=+f;n<u.length-d;++n)p.push(t[l[u[n]][2]]);return p}return n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n},t.geom.polygon=function(t){return j(t,oa),t};var oa=t.geom.polygon.prototype=[];function la(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function sa(t,e,r,n){var a=t[0],i=r[0],o=e[0]-a,l=n[0]-i,s=t[1],c=r[1],u=e[1]-s,f=n[1]-c,d=(l*(s-c)-f*(a-i))/(f*o-l*u);return[a+d*o,s+d*u]}function ca(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}oa.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],a=0;++e<r;)t=n,n=this[e],a+=t[1]*n[0]-t[0]*n[1];return.5*a},oa.centroid=function(t){var e,r,n=-1,a=this.length,i=0,o=0,l=this[a-1];for(arguments.length||(t=-1/(6*this.area()));++n<a;)e=l,l=this[n],r=e[0]*l[1]-l[0]*e[1],i+=(e[0]+l[0])*r,o+=(e[1]+l[1])*r;return[i*t,o*t]},oa.clip=function(t){for(var e,r,n,a,i,o,l=ca(t),s=-1,c=this.length-ca(this),u=this[c-1];++s<c;){for(e=t.slice(),t.length=0,a=this[s],i=e[(n=e.length-l)-1],r=-1;++r<n;)la(o=e[r],u,a)?(la(i,u,a)||t.push(sa(i,o,u,a)),t.push(o)):la(i,u,a)&&t.push(sa(i,o,u,a)),i=o;l&&t.push(t[0]),u=a}return t};var ua,fa,da,pa,ha,ga=[],va=[];function ma(){Ra(this),this.edge=this.site=this.circle=null}function ya(t){var e=ga.pop()||new ma;return e.site=t,e}function xa(t){Sa(t),da.remove(t),ga.push(t),Ra(t)}function ba(t){var e=t.circle,r=e.x,n=e.cy,a={x:r,y:n},i=t.P,o=t.N,l=[t];xa(t);for(var s=i;s.circle&&y(r-s.circle.x)<kt&&y(n-s.circle.cy)<kt;)i=s.P,l.unshift(s),xa(s),s=i;l.unshift(s),Sa(s);for(var c=o;c.circle&&y(r-c.circle.x)<kt&&y(n-c.circle.cy)<kt;)o=c.N,l.push(c),xa(c),c=o;l.push(c),Sa(c);var u,f=l.length;for(u=1;u<f;++u)c=l[u],s=l[u-1],Pa(c.edge,s.site,c.site,a);s=l[0],(c=l[f-1]).edge=Da(s.site,c.site,null,a),La(s),La(c)}function _a(t){for(var e,r,n,a,i=t.x,o=t.y,l=da._;l;)if((n=wa(l,o)-i)>kt)l=l.L;else{if(!((a=i-Ta(l,o))>kt)){n>-kt?(e=l.P,r=l):a>-kt?(e=l,r=l.N):e=r=l;break}if(!l.R){e=l;break}l=l.R}var s=ya(t);if(da.insert(e,s),e||r){if(e===r)return Sa(e),r=ya(e.site),da.insert(s,r),s.edge=r.edge=Da(e.site,s.site),La(e),void La(r);if(r){Sa(e),Sa(r);var c=e.site,u=c.x,f=c.y,d=t.x-u,p=t.y-f,h=r.site,g=h.x-u,v=h.y-f,m=2*(d*v-p*g),y=d*d+p*p,x=g*g+v*v,b={x:(v*y-p*x)/m+u,y:(d*x-g*y)/m+f};Pa(r.edge,c,h,b),s.edge=Da(c,t,null,b),r.edge=Da(t,h,null,b),La(e),La(r)}else s.edge=Da(e.site,s.site)}}function wa(t,e){var r=t.site,n=r.x,a=r.y,i=a-e;if(!i)return n;var o=t.P;if(!o)return-1/0;var l=(r=o.site).x,s=r.y,c=s-e;if(!c)return l;var u=l-n,f=1/i-1/c,d=u/c;return f?(-d+Math.sqrt(d*d-2*f*(u*u/(-2*c)-s+c/2+a-i/2)))/f+n:(n+l)/2}function Ta(t,e){var r=t.N;if(r)return wa(r,e);var n=t.site;return n.y===e?n.x:1/0}function ka(t){this.site=t,this.edges=[]}function Ma(t,e){return e.angle-t.angle}function Aa(){Ra(this),this.x=this.y=this.arc=this.site=this.cy=null}function La(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,i=r.site;if(n!==i){var o=a.x,l=a.y,s=n.x-o,c=n.y-l,u=i.x-o,f=2*(s*(v=i.y-l)-c*u);if(!(f>=-Mt)){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=va.pop()||new Aa;m.arc=t,m.site=a,m.x=h+o,m.y=v+Math.sqrt(h*h+g*g),m.cy=v,t.circle=m;for(var y=null,x=ha._;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}ha.insert(y,m),y||(pa=m)}}}}function Sa(t){var e=t.circle;e&&(e.P||(pa=e.N),ha.remove(e),va.push(e),Ra(e),t.circle=null)}function Ca(t,e){var r=t.b;if(r)return!0;var n,a,i=t.a,o=e[0][0],l=e[1][0],s=e[0][1],c=e[1][1],u=t.l,f=t.r,d=u.x,p=u.y,h=f.x,g=f.y,v=(d+h)/2,m=(p+g)/2;if(g===p){if(v<o||v>=l)return;if(d>h){if(i){if(i.y>=c)return}else i={x:v,y:s};r={x:v,y:c}}else{if(i){if(i.y<s)return}else i={x:v,y:c};r={x:v,y:s}}}else if(a=m-(n=(d-h)/(g-p))*v,n<-1||n>1)if(d>h){if(i){if(i.y>=c)return}else i={x:(s-a)/n,y:s};r={x:(c-a)/n,y:c}}else{if(i){if(i.y<s)return}else i={x:(c-a)/n,y:c};r={x:(s-a)/n,y:s}}else if(p<g){if(i){if(i.x>=l)return}else i={x:o,y:n*o+a};r={x:l,y:n*l+a}}else{if(i){if(i.x<o)return}else i={x:l,y:n*l+a};r={x:o,y:n*o+a}}return t.a=i,t.b=r,!0}function Oa(t,e){this.l=t,this.r=e,this.a=this.b=null}function Da(t,e,r,n){var a=new Oa(t,e);return ua.push(a),r&&Pa(a,t,e,r),n&&Pa(a,e,t,n),fa[t.i].edges.push(new Ea(a,t,e)),fa[e.i].edges.push(new Ea(a,e,t)),a}function za(t,e,r){var n=new Oa(t,null);return n.a=e,n.b=r,ua.push(n),n}function Pa(t,e,r,n){t.a||t.b?t.l===r?t.b=n:t.a=n:(t.a=n,t.l=e,t.r=r)}function Ea(t,e,r){var n=t.a,a=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(a.x-n.x,n.y-a.y):Math.atan2(n.x-a.x,a.y-n.y)}function Ia(){this._=null}function Ra(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Fa(t,e){var r=e,n=e.R,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function Na(t,e){var r=e,n=e.L,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function Ba(t){for(;t.L;)t=t.L;return t}function Ha(t,e){var r,n,a,i=t.sort(ja).pop();for(ua=[],fa=new Array(t.length),da=new Ia,ha=new Ia;;)if(a=pa,i&&(!a||i.y<a.y||i.y===a.y&&i.x<a.x))i.x===r&&i.y===n||(fa[i.i]=new ka(i),_a(i),r=i.x,n=i.y),i=t.pop();else{if(!a)break;ba(a.arc)}e&&(function(t){for(var e,r=ua,n=rn(t[0][0],t[0][1],t[1][0],t[1][1]),a=r.length;a--;)(!Ca(e=r[a],t)||!n(e)||y(e.a.x-e.b.x)<kt&&y(e.a.y-e.b.y)<kt)&&(e.a=e.b=null,r.splice(a,1))}(e),function(t){for(var e,r,n,a,i,o,l,s,c,u,f=t[0][0],d=t[1][0],p=t[0][1],h=t[1][1],g=fa,v=g.length;v--;)if((i=g[v])&&i.prepare())for(s=(l=i.edges).length,o=0;o<s;)n=(u=l[o].end()).x,a=u.y,e=(c=l[++o%s].start()).x,r=c.y,(y(n-e)>kt||y(a-r)>kt)&&(l.splice(o,0,new Ea(za(i.site,u,y(n-f)<kt&&h-a>kt?{x:f,y:y(e-f)<kt?r:h}:y(a-h)<kt&&d-n>kt?{x:y(r-h)<kt?e:d,y:h}:y(n-d)<kt&&a-p>kt?{x:d,y:y(e-d)<kt?r:p}:y(a-p)<kt&&n-f>kt?{x:y(r-p)<kt?e:f,y:p}:null),i.site,null)),++s)}(e));var o={cells:fa,edges:ua};return da=ha=ua=fa=null,o}function ja(t,e){return e.y-t.y||e.x-t.x}ka.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)(t=e[r].edge).b&&t.a||e.splice(r,1);return e.sort(Ma),e.length},Ea.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},Ia.prototype={insert:function(t,e){var r,n,a;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;r=t}else this._?(t=Ba(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)r===(n=r.U).L?(a=n.R)&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.R&&(Fa(this,r),r=(t=r).U),r.C=!1,n.C=!0,Na(this,n)):(a=n.L)&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.L&&(Na(this,r),r=(t=r).U),r.C=!1,n.C=!0,Fa(this,n)),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,a=t.U,i=t.L,o=t.R;if(r=i?o?Ba(o):i:o,a?a.L===t?a.L=r:a.R=r:this._=r,i&&o?(n=r.C,r.C=t.C,r.L=i,i.U=r,r!==o?(a=r.U,r.U=t.U,t=r.R,a.L=t,r.R=o,o.U=r):(r.U=a,a=r,t=r.R)):(n=t.C,t=r),t&&(t.U=a),!n)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===a.L){if((e=a.R).C&&(e.C=!1,a.C=!0,Fa(this,a),e=a.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Na(this,e),e=a.R),e.C=a.C,a.C=e.R.C=!1,Fa(this,a),t=this._;break}}else if((e=a.L).C&&(e.C=!1,a.C=!0,Na(this,a),e=a.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Fa(this,e),e=a.L),e.C=a.C,a.C=e.L.C=!1,Na(this,a),t=this._;break}e.C=!0,t=a,a=a.U}while(!t.C);t&&(t.C=!1)}}},t.geom.voronoi=function(t){var e=ra,r=na,n=e,a=r,i=Ua;if(t)return o(t);function o(t){var e=new Array(t.length),r=i[0][0],n=i[0][1],a=i[1][0],o=i[1][1];return Ha(l(t),i).cells.forEach((function(i,l){var s=i.edges,c=i.site;(e[l]=s.length?s.map((function(t){var e=t.start();return[e.x,e.y]})):c.x>=r&&c.x<=a&&c.y>=n&&c.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=t[l]})),e}function l(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/kt)*kt,y:Math.round(a(t,e)/kt)*kt,i:e}}))}return o.links=function(t){return Ha(l(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return Ha(l(t)).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;)d,a=p,p=(d=c[u].edge).l===s?d.r:d.l,n<a.i&&n<p.i&&(o=a,l=p,((i=s).x-l.x)*(o.y-i.y)-(i.x-o.x)*(l.y-i.y)<0)&&e.push([t[n],t[a.i],t[p.i]])})),e},o.x=function(t){return arguments.length?(n=he(e=t),o):e},o.y=function(t){return arguments.length?(a=he(r=t),o):r},o.clipExtent=function(t){return arguments.length?(i=null==t?Ua:t,o):i===Ua?null:i},o.size=function(t){return arguments.length?o.clipExtent(t&&[[0,0],t]):i===Ua?null:i&&i[1]},o};var Ua=[[-1e6,-1e6],[1e6,1e6]];function Va(t){return t.x}function qa(t){return t.y}function Ga(t,e,r,n,a,i){if(!t(e,r,n,a,i)){var o=.5*(r+a),l=.5*(n+i),s=e.nodes;s[0]&&Ga(t,s[0],r,n,o,l),s[1]&&Ga(t,s[1],o,n,a,l),s[2]&&Ga(t,s[2],r,l,o,i),s[3]&&Ga(t,s[3],o,l,a,i)}}function Za(t,e,r,n,a,i,o){var l,s=1/0;return function t(c,u,f,d,p){if(!(u>i||f>o||d<n||p<a)){if(h=c.point){var h,g=e-c.x,v=r-c.y,m=g*g+v*v;if(m<s){var y=Math.sqrt(s=m);n=e-y,a=r-y,i=e+y,o=r+y,l=h}}for(var x=c.nodes,b=.5*(u+d),_=.5*(f+p),w=(r>=_)<<1|e>=b,T=w+4;w<T;++w)if(c=x[3&w])switch(3&w){case 0:t(c,u,f,b,_);break;case 1:t(c,b,f,d,_);break;case 2:t(c,u,_,b,p);break;case 3:t(c,b,_,d,p)}}}(t,n,a,i,o),l}function Ya(e,r){e=t.rgb(e),r=t.rgb(r);var n=e.r,a=e.g,i=e.b,o=r.r-n,l=r.g-a,s=r.b-i;return function(t){return"#"+le(Math.round(n+o*t))+le(Math.round(a+l*t))+le(Math.round(i+s*t))}}function Xa(t,e){var r,n={},a={};for(r in t)r in e?n[r]=Ka(t[r],e[r]):a[r]=t[r];for(r in e)r in t||(a[r]=e[r]);return function(t){for(r in n)a[r]=n[r](t);return a}}function Wa(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Qa(t,e){var r,n,a,i=Ja.lastIndex=$a.lastIndex=0,o=-1,l=[],s=[];for(t+="",e+="";(r=Ja.exec(t))&&(n=$a.exec(e));)(a=n.index)>i&&(a=e.slice(i,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(n=n[0])?l[o]?l[o]+=n:l[++o]=n:(l[++o]=null,s.push({i:o,x:Wa(r,n)})),i=$a.lastIndex;return i<e.length&&(a=e.slice(i),l[o]?l[o]+=a:l[++o]=a),l.length<2?s[0]?(e=s[0].x,function(t){return e(t)+""}):function(){return e}:(e=s.length,function(t){for(var r,n=0;n<e;++n)l[(r=s[n]).i]=r.x(t);return l.join("")})}t.geom.delaunay=function(e){return t.geom.voronoi().triangles(e)},t.geom.quadtree=function(t,e,r,n,a){var i,o=ra,l=na;if(i=arguments.length)return o=Va,l=qa,3===i&&(a=r,n=e,r=e=0),s(t);function s(t){var s,c,u,f,d,p,h,g,v,m=he(o),x=he(l);if(null!=e)p=e,h=r,g=n,v=a;else if(g=v=-(p=h=1/0),c=[],u=[],d=t.length,i)for(f=0;f<d;++f)(s=t[f]).x<p&&(p=s.x),s.y<h&&(h=s.y),s.x>g&&(g=s.x),s.y>v&&(v=s.y),c.push(s.x),u.push(s.y);else for(f=0;f<d;++f){var b=+m(s=t[f],f),_=+x(s,f);b<p&&(p=b),_<h&&(h=_),b>g&&(g=b),_>v&&(v=_),c.push(b),u.push(_)}var w=g-p,T=v-h;function k(t,e,r,n,a,i,o,l){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var s=t.x,c=t.y;if(null!=s)if(y(s-r)+y(c-n)<.01)M(t,e,r,n,a,i,o,l);else{var u=t.point;t.x=t.y=t.point=null,M(t,u,s,c,a,i,o,l),M(t,e,r,n,a,i,o,l)}else t.x=r,t.y=n,t.point=e}else M(t,e,r,n,a,i,o,l)}function M(t,e,r,n,a,i,o,l){var s=.5*(a+o),c=.5*(i+l),u=r>=s,f=n>=c,d=f<<1|u;t.leaf=!1,u?a=s:o=s,f?i=c:l=c,k(t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,a,i,o,l)}w>T?v=h+w:g=p+T;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(A,t,+m(t,++f),+x(t,f),p,h,g,v)},visit:function(t){Ga(t,A,p,h,g,v)},find:function(t){return Za(A,t[0],t[1],p,h,g,v)}};if(f=-1,null==e){for(;++f<d;)k(A,t[f],c[f],u[f],p,h,g,v);--f}else t.forEach(A.add);return c=u=t=s=null,A}return s.x=function(t){return arguments.length?(o=t,s):o},s.y=function(t){return arguments.length?(l=t,s):l},s.extent=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],a=+t[1][1]),s):null==e?null:[[e,r],[n,a]]},s.size=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=r=0,n=+t[0],a=+t[1]),s):null==e?null:[n-e,a-r]},s},t.interpolateRgb=Ya,t.interpolateObject=Xa,t.interpolateNumber=Wa,t.interpolateString=Qa;var Ja=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$a=new RegExp(Ja.source,"g");function Ka(e,r){for(var n,a=t.interpolators.length;--a>=0&&!(n=t.interpolators[a](e,r)););return n}function ti(t,e){var r,n=[],a=[],i=t.length,o=e.length,l=Math.min(t.length,e.length);for(r=0;r<l;++r)n.push(Ka(t[r],e[r]));for(;r<i;++r)a[r]=t[r];for(;r<o;++r)a[r]=e[r];return function(t){for(r=0;r<l;++r)a[r]=n[r](t);return a}}t.interpolate=Ka,t.interpolators=[function(t,e){var r=typeof e;return("string"===r?pe.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?Ya:Qa:e instanceof Ut?Ya:Array.isArray(e)?ti:"object"===r&&isNaN(e)?Xa:Wa)(t,e)}],t.interpolateArray=ti;var ei=function(){return O},ri=t.map({linear:ei,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return li},cubic:function(){return si},sin:function(){return ui},exp:function(){return fi},circle:function(){return di},elastic:function(t,e){var r;arguments.length<2&&(e=.45);arguments.length?r=e/Lt*Math.asin(1/t):(t=1,r=e/4);return function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Lt/e)}},back:function(t){t||(t=1.70158);return function(e){return e*e*((t+1)*e-t)}},bounce:function(){return pi}}),ni=t.map({in:O,out:ii,"in-out":oi,"out-in":function(t){return oi(ii(t))}});function ai(t){return function(e){return e<=0?0:e>=1?1:t(e)}}function ii(t){return function(e){return 1-t(1-e)}}function oi(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function li(t){return t*t}function si(t){return t*t*t}function ci(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function ui(t){return 1-Math.cos(t*Ct)}function fi(t){return Math.pow(2,10*(t-1))}function di(t){return 1-Math.sqrt(1-t*t)}function pi(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function hi(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function gi(t){var e,r,n,a=[t.a,t.b],i=[t.c,t.d],o=mi(a),l=vi(a,i),s=mi(((e=i)[0]+=(n=-l)*(r=a)[0],e[1]+=n*r[1],e))||0;a[0]*i[1]<i[0]*a[1]&&(a[0]*=-1,a[1]*=-1,o*=-1,l*=-1),this.rotate=(o?Math.atan2(a[1],a[0]):Math.atan2(-i[0],i[1]))*Dt,this.translate=[t.e,t.f],this.scale=[o,s],this.skew=s?Math.atan2(l,s)*Dt:0}function vi(t,e){return t[0]*e[0]+t[1]*e[1]}function mi(t){var e=Math.sqrt(vi(t,t));return e&&(t[0]/=e,t[1]/=e),e}t.ease=function(t){var e=t.indexOf("-"),n=e>=0?t.slice(0,e):t,a=e>=0?t.slice(e+1):"in";return n=ri.get(n)||ei,ai((a=ni.get(a)||O)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,a=e.c,i=e.l,o=r.h-n,l=r.c-a,s=r.l-i;isNaN(l)&&(l=0,a=isNaN(a)?r.c:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Xt(n+o*t,a+l*t,i+s*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,a=e.s,i=e.l,o=r.h-n,l=r.s-a,s=r.l-i;isNaN(l)&&(l=0,a=isNaN(a)?r.s:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Gt(n+o*t,a+l*t,i+s*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,a=e.a,i=e.b,o=r.l-n,l=r.a-a,s=r.b-i;return function(t){return $t(n+o*t,a+l*t,i+s*t)+""}},t.interpolateRound=hi,t.transform=function(e){var r=a.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new gi(e?e.matrix:yi)})(e)},gi.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var yi={a:1,b:0,c:0,d:1,e:0,f:0};function xi(t){return t.length?t.pop()+",":""}function bi(e,r){var n=[],a=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:Wa(t[0],e[0])},{i:a-2,x:Wa(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,a),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(xi(r)+"rotate(",null,")")-2,x:Wa(t,e)})):e&&r.push(xi(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,a),function(t,e,r,n){t!==e?n.push({i:r.push(xi(r)+"skewX(",null,")")-2,x:Wa(t,e)}):e&&r.push(xi(r)+"skewX("+e+")")}(e.skew,r.skew,n,a),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(xi(r)+"scale(",null,",",null,")");n.push({i:a-4,x:Wa(t[0],e[0])},{i:a-2,x:Wa(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(xi(r)+"scale("+e+")")}(e.scale,r.scale,n,a),e=r=null,function(t){for(var e,r=-1,i=a.length;++r<i;)n[(e=a[r]).i]=e.x(t);return n.join("")}}function _i(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function wi(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Ti(t){for(var e=t.source,r=t.target,n=function(t,e){if(t===e)return t;var r=ki(t),n=ki(e),a=r.pop(),i=n.pop(),o=null;for(;a===i;)o=a,a=r.pop(),i=n.pop();return o}(e,r),a=[e];e!==n;)e=e.parent,a.push(e);for(var i=a.length;r!==n;)a.splice(i,0,r),r=r.parent;return a}function ki(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function Mi(t){t.fixed|=2}function Ai(t){t.fixed&=-7}function Li(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Si(t){t.fixed&=-5}t.interpolateTransform=bi,t.layout={},t.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(Ti(t[r]));return e}},t.layout.chord=function(){var e,r,n,a,i,o,l,s={},c=0;function u(){var s,u,d,p,h,g={},v=[],m=t.range(a),y=[];for(e=[],r=[],s=0,p=-1;++p<a;){for(u=0,h=-1;++h<a;)u+=n[p][h];v.push(u),y.push(t.range(a)),s+=u}for(i&&m.sort((function(t,e){return i(v[t],v[e])})),o&&y.forEach((function(t,e){t.sort((function(t,r){return o(n[e][t],n[e][r])}))})),s=(Lt-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,T=u+=_*s;g[x+"-"+b]={index:x,subindex:b,startAngle:w,endAngle:T,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 k=g[p+"-"+h],M=g[h+"-"+p];(k.value||M.value)&&e.push(k.value<M.value?{source:M,target:k}:{source:k,target:M})}l&&f()}function f(){e.sort((function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)}))}return s.matrix=function(t){return arguments.length?(a=(n=t)&&n.length,e=r=null,s):n},s.padding=function(t){return arguments.length?(c=t,e=r=null,s):c},s.sortGroups=function(t){return arguments.length?(i=t,e=r=null,s):i},s.sortSubgroups=function(t){return arguments.length?(o=t,e=null,s):o},s.sortChords=function(t){return arguments.length?(l=t,e&&f(),s):l},s.chords=function(){return e||u(),e},s.groups=function(){return r||u(),r},s},t.layout.force=function(){var e,r,n,a,i,o,l={},s=t.dispatch("start","tick","end"),c=[1,1],u=.9,f=Ci,d=Oi,p=-30,h=Di,g=.1,v=.64,m=[],y=[];function x(t){return function(e,r,n,a){if(e.point!==t){var i=e.cx-t.x,o=e.cy-t.y,l=a-r,s=i*i+o*o;if(l*l/v<s){if(s<h){var c=e.charge/s;t.px-=i*c,t.py-=o*c}return!0}if(e.point&&s&&s<h){c=e.pointCharge/s;t.px-=i*c,t.py-=o*c}}return!e.charge}}function b(e){e.px=t.event.x,e.py=t.event.y,l.resume()}return l.tick=function(){if((n*=.99)<.005)return e=null,s.end({type:"end",alpha:n=0}),!0;var r,l,f,d,h,v,b,_,w,T=m.length,k=y.length;for(l=0;l<k;++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<T;)(f=m[l]).x+=(_-f.x)*b,f.y+=(w-f.y)*b;if(p)for(!function t(e,r,n){var a=0,i=0;if(e.charge=0,!e.leaf)for(var o,l=e.nodes,s=l.length,c=-1;++c<s;)null!=(o=l[c])&&(t(o,r,n),e.charge+=o.charge,a+=o.charge*o.cx,i+=o.charge*o.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var u=r*n[e.point.index];e.charge+=e.pointCharge=u,a+=u*e.point.x,i+=u*e.point.y}e.cx=a/e.charge,e.cy=i/e.charge}(r=t.geom.quadtree(m),n,o),l=-1;++l<T;)(f=m[l]).fixed||r.visit(x(f));for(l=-1;++l<T;)(f=m[l]).fixed?(f.x=f.px,f.y=f.py):(f.x-=(f.px-(f.px=f.x))*u,f.y-=(f.py-(f.py=f.y))*u);s.tick({type:"tick",alpha:n})},l.nodes=function(t){return arguments.length?(m=t,l):m},l.links=function(t){return arguments.length?(y=t,l):y},l.size=function(t){return arguments.length?(c=t,l):c},l.linkDistance=function(t){return arguments.length?(f="function"==typeof t?t:+t,l):f},l.distance=l.linkDistance,l.linkStrength=function(t){return arguments.length?(d="function"==typeof t?t:+t,l):d},l.friction=function(t){return arguments.length?(u=+t,l):u},l.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,l):p},l.chargeDistance=function(t){return arguments.length?(h=t*t,l):Math.sqrt(h)},l.gravity=function(t){return arguments.length?(g=+t,l):g},l.theta=function(t){return arguments.length?(v=t*t,l):Math.sqrt(v)},l.alpha=function(t){return arguments.length?(t=+t,n?t>0?n=t:(e.c=null,e.t=NaN,e=null,s.end({type:"end",alpha:n=0})):t>0&&(s.start({type:"start",alpha:n=t}),e=we(l.tick)),l):n},l.start=function(){var t,e,r,n=m.length,s=y.length,u=c[0],h=c[1];for(t=0;t<n;++t)(r=m[t]).index=t,r.weight=0;for(t=0;t<s;++t)"number"==typeof(r=y[t]).source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(t=0;t<n;++t)r=m[t],isNaN(r.x)&&(r.x=g("x",u)),isNaN(r.y)&&(r.y=g("y",h)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(a=[],"function"==typeof f)for(t=0;t<s;++t)a[t]=+f.call(this,y[t],t);else for(t=0;t<s;++t)a[t]=f;if(i=[],"function"==typeof d)for(t=0;t<s;++t)i[t]=+d.call(this,y[t],t);else for(t=0;t<s;++t)i[t]=d;if(o=[],"function"==typeof p)for(t=0;t<n;++t)o[t]=+p.call(this,m[t],t);else for(t=0;t<n;++t)o[t]=p;function g(r,a){if(!e){for(e=new Array(n),c=0;c<n;++c)e[c]=[];for(c=0;c<s;++c){var i=y[c];e[i.source.index].push(i.target),e[i.target.index].push(i.source)}}for(var o,l=e[t],c=-1,u=l.length;++c<u;)if(!isNaN(o=l[c][r]))return o;return Math.random()*a}return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){if(r||(r=t.behavior.drag().origin(O).on("dragstart.force",Mi).on("drag.force",b).on("dragend.force",Ai)),!arguments.length)return r;this.on("mouseover.force",Li).on("mouseout.force",Si).call(r)},t.rebind(l,s,"on")};var Ci=20,Oi=1,Di=1/0;function zi(e,r){return t.rebind(e,r,"sort","children","value"),e.nodes=e,e.links=Ni,e}function Pi(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(a=t.children)&&(n=a.length))for(var n,a;--n>=0;)r.push(a[n])}function Ei(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(i=t.children)&&(a=i.length))for(var a,i,o=-1;++o<a;)r.push(i[o]);for(;null!=(t=n.pop());)e(t)}function Ii(t){return t.children}function Ri(t){return t.value}function Fi(t,e){return e.value-t.value}function Ni(e){return t.merge(e.map((function(t){return(t.children||[]).map((function(e){return{source:t,target:e}}))})))}t.layout.hierarchy=function(){var t=Fi,e=Ii,r=Ri;function n(a){var i,o=[a],l=[];for(a.depth=0;null!=(i=o.pop());)if(l.push(i),(c=e.call(n,i,i.depth))&&(s=c.length)){for(var s,c,u;--s>=0;)o.push(u=c[s]),u.parent=i,u.depth=i.depth+1;r&&(i.value=0),i.children=c}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Ei(a,(function(e){var n,a;t&&(n=e.children)&&n.sort(t),r&&(a=e.parent)&&(a.value+=e.value)})),l}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Pi(t,(function(t){t.children&&(t.value=0)})),Ei(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var a=e.call(this,t,n);return function t(e,r,n,a){var i=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,i&&(o=i.length)){var o,l,s,c=-1;for(n=e.value?n/e.value:0;++c<o;)t(l=i[c],r,s=l.value*n,a),r+=s}}(a[0],0,r[0],r[1]/function t(e){var r=e.children,n=0;if(r&&(a=r.length))for(var a,i=-1;++i<a;)n=Math.max(n,t(r[i]));return 1+n}(a[0])),a}return n.size=function(t){return arguments.length?(r=t,n):r},zi(n,e)},t.layout.pie=function(){var e=Number,r=Bi,n=0,a=Lt,i=0;function o(l){var s,c=l.length,u=l.map((function(t,r){return+e.call(o,t,r)})),f=+("function"==typeof n?n.apply(this,arguments):n),d=("function"==typeof a?a.apply(this,arguments):a)-f,p=Math.min(Math.abs(d)/c,+("function"==typeof i?i.apply(this,arguments):i)),h=p*(d<0?-1:1),g=t.sum(u),v=g?(d-c*h)/g:0,m=t.range(c),y=[];return null!=r&&m.sort(r===Bi?function(t,e){return u[e]-u[t]}:function(t,e){return r(l[t],l[e])}),m.forEach((function(t){y[t]={data:l[t],value:s=u[t],startAngle:f,endAngle:f+=s*v+h,padAngle:p}})),y}return o.value=function(t){return arguments.length?(e=t,o):e},o.sort=function(t){return arguments.length?(r=t,o):r},o.startAngle=function(t){return arguments.length?(n=t,o):n},o.endAngle=function(t){return arguments.length?(a=t,o):a},o.padAngle=function(t){return arguments.length?(i=t,o):i},o};var Bi={};function Hi(t){return t.x}function ji(t){return t.y}function Ui(t,e,r){t.y0=e,t.y=r}t.layout.stack=function(){var e=O,r=Gi,n=Zi,a=Ui,i=Hi,o=ji;function l(s,c){if(!(p=s.length))return s;var u=s.map((function(t,r){return e.call(l,t,r)})),f=u.map((function(t){return t.map((function(t,e){return[i.call(l,t,e),o.call(l,t,e)]}))})),d=r.call(l,f,c);u=t.permute(u,d),f=t.permute(f,d);var p,h,g,v,m=n.call(l,f,c),y=u[0].length;for(g=0;g<y;++g)for(a.call(l,u[0][g],v=m[g],f[0][g][1]),h=1;h<p;++h)a.call(l,u[h][g],v+=f[h-1][g][1],f[h][g][1]);return s}return l.values=function(t){return arguments.length?(e=t,l):e},l.order=function(t){return arguments.length?(r="function"==typeof t?t:Vi.get(t)||Gi,l):r},l.offset=function(t){return arguments.length?(n="function"==typeof t?t:qi.get(t)||Zi,l):n},l.x=function(t){return arguments.length?(i=t,l):i},l.y=function(t){return arguments.length?(o=t,l):o},l.out=function(t){return arguments.length?(a=t,l):a},l};var Vi=t.map({"inside-out":function(e){var r,n,a=e.length,i=e.map(Yi),o=e.map(Xi),l=t.range(a).sort((function(t,e){return i[t]-i[e]})),s=0,c=0,u=[],f=[];for(r=0;r<a;++r)n=l[r],s<c?(s+=o[n],u.push(n)):(c+=o[n],f.push(n));return f.reverse().concat(u)},reverse:function(e){return t.range(e.length).reverse()},default:Gi}),qi=t.map({silhouette:function(t){var e,r,n,a=t.length,i=t[0].length,o=[],l=0,s=[];for(r=0;r<i;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];n>l&&(l=n),o.push(n)}for(r=0;r<i;++r)s[r]=(l-o[r])/2;return s},wiggle:function(t){var e,r,n,a,i,o,l,s,c,u=t.length,f=t[0],d=f.length,p=[];for(p[0]=s=c=0,r=1;r<d;++r){for(e=0,a=0;e<u;++e)a+=t[e][r][1];for(e=0,i=0,l=f[r][0]-f[r-1][0];e<u;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*l);n<e;++n)o+=(t[n][r][1]-t[n][r-1][1])/l;i+=o*t[e][r][1]}p[r]=s-=a?i/a*l:0,s<c&&(c=s)}for(r=0;r<d;++r)p[r]-=c;return p},expand:function(t){var e,r,n,a=t.length,i=t[0].length,o=1/a,l=[];for(r=0;r<i;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];if(n)for(e=0;e<a;e++)t[e][r][1]/=n;else for(e=0;e<a;e++)t[e][r][1]=o}for(r=0;r<i;++r)l[r]=0;return l},zero:Zi});function Gi(e){return t.range(e.length)}function Zi(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function Yi(t){for(var e,r=1,n=0,a=t[0][1],i=t.length;r<i;++r)(e=t[r][1])>a&&(n=r,a=e);return n}function Xi(t){return t.reduce(Wi,0)}function Wi(t,e){return t+e[1]}function Qi(t,e){return Ji(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Ji(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,i=[];++r<=e;)i[r]=a*r+n;return i}function $i(e){return[t.min(e),t.max(e)]}function Ki(t,e){return t.value-e.value}function to(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function eo(t,e){t._pack_next=e,e._pack_prev=t}function ro(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function no(t){if((e=t.children)&&(s=e.length)){var e,r,n,a,i,o,l,s,c=1/0,u=-1/0,f=1/0,d=-1/0;if(e.forEach(ao),(r=e[0]).x=-r.r,r.y=0,x(r),s>1&&((n=e[1]).x=n.r,n.y=0,x(n),s>2))for(oo(r,n,a=e[2]),x(a),to(r,a),r._pack_prev=a,to(a,n),n=r._pack_next,i=3;i<s;i++){oo(r,n,a=e[i]);var p=0,h=1,g=1;for(o=n._pack_next;o!==n;o=o._pack_next,h++)if(ro(o,a)){p=1;break}if(1==p)for(l=r._pack_prev;l!==o._pack_prev&&!ro(l,a);l=l._pack_prev,g++);p?(h<g||h==g&&n.r<r.r?eo(r,n=o):eo(r=l,n),i--):(to(r,a),n=a,x(a))}var v=(c+u)/2,m=(f+d)/2,y=0;for(i=0;i<s;i++)(a=e[i]).x-=v,a.y-=m,y=Math.max(y,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=y,e.forEach(io)}function x(t){c=Math.min(t.x-t.r,c),u=Math.max(t.x+t.r,u),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}}function ao(t){t._pack_next=t._pack_prev=t}function io(t){delete t._pack_next,delete t._pack_prev}function oo(t,e,r){var n=t.r+r.r,a=e.x-t.x,i=e.y-t.y;if(n&&(a||i)){var o=e.r+r.r,l=a*a+i*i,s=.5+((n*=n)-(o*=o))/(2*l),c=Math.sqrt(Math.max(0,2*o*(n+l)-(n-=l)*n-o*o))/(2*l);r.x=t.x+s*a+c*i,r.y=t.y+s*i-c*a}else r.x=t.x+n,r.y=t.y}function lo(t,e){return t.parent==e.parent?1:2}function so(t){var e=t.children;return e.length?e[0]:t.t}function co(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function uo(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function fo(t,e,r){return t.a.parent===e.parent?t.a:r}function po(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function ho(t,e){var r=t.x+e[3],n=t.y+e[0],a=t.dx-e[1]-e[3],i=t.dy-e[0]-e[2];return a<0&&(r+=a/2,a=0),i<0&&(n+=i/2,i=0),{x:r,y:n,dx:a,dy:i}}function go(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function vo(t){return t.rangeExtent?t.rangeExtent():go(t.range())}function mo(t,e,r,n){var a=r(t[0],t[1]),i=n(e[0],e[1]);return function(t){return i(a(t))}}function yo(t,e){var r,n=0,a=t.length-1,i=t[n],o=t[a];return o<i&&(r=n,n=a,a=r,r=i,i=o,o=r),t[n]=e.floor(i),t[a]=e.ceil(o),t}function xo(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:bo}t.layout.histogram=function(){var e=!0,r=Number,n=$i,a=Qi;function i(i,o){for(var l,s,c=[],u=i.map(r,this),f=n.call(this,u,o),d=a.call(this,f,u,o),p=(o=-1,u.length),h=d.length-1,g=e?1:1/p;++o<h;)(l=c[o]=[]).dx=d[o+1]-(l.x=d[o]),l.y=0;if(h>0)for(o=-1;++o<p;)(s=u[o])>=f[0]&&s<=f[1]&&((l=c[t.bisect(d,s,1,h)-1]).y+=g,l.push(i[o]));return c}return i.value=function(t){return arguments.length?(r=t,i):r},i.range=function(t){return arguments.length?(n=he(t),i):n},i.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return Ji(e,t)}:he(t),i):a},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(Ki),n=0,a=[1,1];function i(t,i){var o=r.call(this,t,i),l=o[0],s=a[0],c=a[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(l.x=l.y=0,Ei(l,(function(t){t.r=+u(t.value)})),Ei(l,no),n){var f=n*(e?1:Math.max(2*l.r/s,2*l.r/c))/2;Ei(l,(function(t){t.r+=f})),Ei(l,no),Ei(l,(function(t){t.r-=f}))}return function t(e,r,n,a){var i=e.children;if(e.x=r+=a*e.x,e.y=n+=a*e.y,e.r*=a,i)for(var o=-1,l=i.length;++o<l;)t(i[o],r,n,a)}(l,s/2,c/2,e?1:1/Math.max(2*l.r/s,2*l.r/c)),o}return i.size=function(t){return arguments.length?(a=t,i):a},i.radius=function(t){return arguments.length?(e=null==t||"function"==typeof t?t:+t,i):e},i.padding=function(t){return arguments.length?(n=+t,i):n},zi(i,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=lo,n=[1,1],a=null;function i(t,i){var c=e.call(this,t,i),u=c[0],f=function(t){var e,r={A:null,children:[t]},n=[r];for(;null!=(e=n.pop());)for(var a,i=e.children,o=0,l=i.length;o<l;++o)n.push((i[o]=a={_:i[o],parent:e,children:(a=i[o].children)&&a.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=a);return r.children[0]}(u);if(Ei(f,o),f.parent.m=-f.z,Pi(f,l),a)Pi(u,s);else{var d=u,p=u,h=u;Pi(u,(function(t){t.x<d.x&&(d=t),t.x>p.x&&(p=t),t.depth>h.depth&&(h=t)}));var g=r(d,p)/2-d.x,v=n[0]/(p.x+r(p,d)/2+g),m=n[1]/(h.depth||1);Pi(u,(function(t){t.x=(t.x+g)*v,t.y=t.depth*m}))}return c}function o(t){var e=t.children,n=t.parent.children,a=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,a=t.children,i=a.length;for(;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var i=(e[0].z+e[e.length-1].z)/2;a?(t.z=a.z+r(t._,a._),t.m=t.z-i):t.z=i}else a&&(t.z=a.z+r(t._,a._));t.parent.A=function(t,e,n){if(e){for(var a,i=t,o=t,l=e,s=i.parent.children[0],c=i.m,u=o.m,f=l.m,d=s.m;l=co(l),i=so(i),l&&i;)s=so(s),(o=co(o)).a=t,(a=l.z+f-i.z-c+r(l._,i._))>0&&(uo(fo(l,t,n),t,a),c+=a,u+=a),f+=l.m,c+=i.m,d+=s.m,u+=o.m;l&&!co(o)&&(o.t=l,o.m+=f-u),i&&!so(s)&&(s.t=i,s.m+=c-d,n=t)}return n}(t,a,t.parent.A||n[0])}function l(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=n[0],t.y=t.depth*n[1]}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t)?s:null,i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null==(n=t)?null:s,i):a?n:null},zi(i,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=lo,n=[1,1],a=!1;function i(i,o){var l,s=e.call(this,i,o),c=s[0],u=0;Ei(c,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=l?u+=r(e,l):0,e.y=0,l=e)}));var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(c),d=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(c),p=f.x-r(f,d)/2,h=d.x+r(d,f)/2;return Ei(c,a?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(h-p)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),s}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t),i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null!=(n=t),i):a?n:null},zi(i,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=po,l=!1,s="squarify",c=.5*(1+Math.sqrt(5));function u(t,e){for(var r,n,a=-1,i=t.length;++a<i;)n=(r=t[a]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function f(t){var e=t.children;if(e&&e.length){var r,n,a,i=o(t),l=[],c=e.slice(),d=1/0,g="slice"===s?i.dx:"dice"===s?i.dy:"slice-dice"===s?1&t.depth?i.dy:i.dx:Math.min(i.dx,i.dy);for(u(c,i.dx*i.dy/t.value),l.area=0;(a=c.length)>0;)l.push(r=c[a-1]),l.area+=r.area,"squarify"!==s||(n=p(l,g))<=d?(c.pop(),d=n):(l.area-=l.pop().area,h(l,g,i,!1),g=Math.min(i.dx,i.dy),l.length=l.area=0,d=1/0);l.length&&(h(l,g,i,!0),l.length=l.area=0),e.forEach(f)}}function d(t){var e=t.children;if(e&&e.length){var r,n=o(t),a=e.slice(),i=[];for(u(a,n.dx*n.dy/t.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(h(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);e.forEach(d)}}function p(t,e){for(var r,n=t.area,a=0,i=1/0,o=-1,l=t.length;++o<l;)(r=t[o].area)&&(r<i&&(i=r),r>a&&(a=r));return e*=e,(n*=n)?Math.max(e*a*c/n,n/(e*i*c)):1/0}function h(t,e,r,a){var i,o=-1,l=t.length,s=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((a||u>r.dy)&&(u=r.dy);++o<l;)(i=t[o]).x=s,i.y=c,i.dy=u,s+=i.dx=Math.min(r.x+r.dx-s,u?n(i.area/u):0);i.z=!0,i.dx+=r.x+r.dx-s,r.y+=u,r.dy-=u}else{for((a||u>r.dx)&&(u=r.dx);++o<l;)(i=t[o]).x=s,i.y=c,i.dx=u,c+=i.dy=Math.min(r.y+r.dy-c,u?n(i.area/u):0);i.z=!1,i.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}function g(t){var n=e||r(t),i=n[0];return i.x=i.y=0,i.value?(i.dx=a[0],i.dy=a[1]):i.dx=i.dy=0,e&&r.revalue(i),u([i],i.dx*i.dy/i.value),(e?d:f)(i),l&&(e=n),n}return g.size=function(t){return arguments.length?(a=t,g):a},g.padding=function(t){if(!arguments.length)return i;function e(e){var r=t.call(g,e,e.depth);return null==r?po(e):ho(e,"number"==typeof r?[r,r,r,r]:r)}function r(e){return ho(e,t)}var n;return o=null==(i=t)?po:"function"==(n=typeof t)?e:"number"===n?(t=[t,t,t,t],r):r,g},g.round=function(t){return arguments.length?(n=t?Math.round:Number,g):n!=Number},g.sticky=function(t){return arguments.length?(l=t,e=null,g):l},g.ratio=function(t){return arguments.length?(c=t,g):c},g.mode=function(t){return arguments.length?(s=t+"",g):s},zi(g,r)},t.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,a;do{a=(r=2*Math.random()-1)*r+(n=2*Math.random()-1)*n}while(!a||a>1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},t.scale={};var bo={floor:O,ceil:O};function _o(e,r,n,a){var i=[],o=[],l=0,s=Math.min(e.length,r.length)-1;for(e[s]<e[0]&&(e=e.slice().reverse(),r=r.slice().reverse());++l<=s;)i.push(n(e[l-1],e[l])),o.push(a(r[l-1],r[l]));return function(r){var n=t.bisect(e,r,1,s)-1;return o[n](i[n](r))}}function wo(e,r){return t.rebind(e,r,"range","rangeRound","interpolate","clamp")}function To(t,e){return yo(t,xo(ko(t,e)[2])),yo(t,xo(ko(t,e)[2])),t}function ko(t,e){null==e&&(e=10);var r=go(t),n=r[1]-r[0],a=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),i=e/n*a;return i<=.15?a*=10:i<=.35?a*=5:i<=.75&&(a*=2),r[0]=Math.ceil(r[0]/a)*a,r[1]=Math.floor(r[1]/a)*a+.5*a,r[2]=a,r}function Mo(e,r){return t.range.apply(t,ko(e,r))}function Ao(e,r,n){var a=ko(e,r);if(n){var i=Ce.exec(n);if(i.shift(),"s"===i[8]){var o=t.formatPrefix(Math.max(y(a[0]),y(a[1])));return i[7]||(i[7]="."+So(o.scale(a[2]))),i[8]="f",n=t.format(i.join("")),function(t){return n(o.scale(t))+o.symbol}}i[7]||(i[7]="."+function(t,e){var r=So(e[2]);return t in Lo?Math.abs(r-So(Math.max(y(e[0]),y(e[1]))))+ +("e"!==t):r-2*("%"===t)}(i[8],a)),n=i.join("")}else n=",."+So(a[2])+"f";return t.format(n)}t.scale.linear=function(){return function t(e,r,n,a){var i,o;function l(){var t=Math.min(e.length,r.length)>2?_o:mo,l=a?wi:_i;return i=t(e,r,l,n),o=t(r,e,l,Ka),s}function s(t){return i(t)}return s.invert=function(t){return o(t)},s.domain=function(t){return arguments.length?(e=t.map(Number),l()):e},s.range=function(t){return arguments.length?(r=t,l()):r},s.rangeRound=function(t){return s.range(t).interpolate(hi)},s.clamp=function(t){return arguments.length?(a=t,l()):a},s.interpolate=function(t){return arguments.length?(n=t,l()):n},s.ticks=function(t){return Mo(e,t)},s.tickFormat=function(t,r){return Ao(e,t,r)},s.nice=function(t){return To(e,t),l()},s.copy=function(){return t(e,r,n,a)},l()}([0,1],[0,1],Ka,!1)};var Lo={s:1,g:1,p:1,r:1,e:1};function So(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,a,i){function o(t){return(a?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function l(t){return a?Math.pow(n,t):-Math.pow(n,-t)}function s(t){return r(o(t))}return s.invert=function(t){return l(r.invert(t))},s.domain=function(t){return arguments.length?(a=t[0]>=0,r.domain((i=t.map(Number)).map(o)),s):i},s.base=function(t){return arguments.length?(n=+t,r.domain(i.map(o)),s):n},s.nice=function(){var t=yo(i.map(o),a?Math:Oo);return r.domain(t),i=t.map(l),s},s.ticks=function(){var t=go(i),e=[],r=t[0],s=t[1],c=Math.floor(o(r)),u=Math.ceil(o(s)),f=n%1?2:n;if(isFinite(u-c)){if(a){for(;c<u;c++)for(var d=1;d<f;d++)e.push(l(c)*d);e.push(l(c))}else for(e.push(l(c));c++<u;)for(d=f-1;d>0;d--)e.push(l(c)*d);for(c=0;e[c]<r;c++);for(u=e.length;e[u-1]>s;u--);e=e.slice(c,u)}return e},s.tickFormat=function(e,r){if(!arguments.length)return Co;arguments.length<2?r=Co:"function"!=typeof r&&(r=t.format(r));var a=Math.max(1,n*e/s.ticks().length);return function(t){var e=t/l(Math.round(o(t)));return e*n<n-.5&&(e*=n),e<=a?r(t):""}},s.copy=function(){return e(r.copy(),n,a,i)},wo(s,r)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Co=t.format(".0e"),Oo={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Do(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var a=Do(r),i=Do(1/r);function o(t){return e(a(t))}return o.invert=function(t){return i(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(a)),o):n},o.ticks=function(t){return Mo(n,t)},o.tickFormat=function(t,e){return Ao(n,t,e)},o.nice=function(t){return o.domain(To(n,t))},o.exponent=function(t){return arguments.length?(a=Do(r=t),i=Do(1/r),e.domain(n.map(a)),o):r},o.copy=function(){return t(e.copy(),r,n)},wo(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var a,i,o;function l(t){return i[((a.get(t)||("range"===n.t?a.set(t,r.push(t)):NaN))-1)%i.length]}function s(e,n){return t.range(r.length).map((function(t){return e+n*t}))}return l.domain=function(t){if(!arguments.length)return r;r=[],a=new _;for(var e,i=-1,o=t.length;++i<o;)a.has(e=t[i])||a.set(e,r.push(e));return l[n.t].apply(l,n.a)},l.range=function(t){return arguments.length?(i=t,o=0,n={t:"range",a:arguments},l):i},l.rangePoints=function(t,e){arguments.length<2&&(e=0);var a=t[0],c=t[1],u=r.length<2?(a=(a+c)/2,0):(c-a)/(r.length-1+e);return i=s(a+u*e/2,u),o=0,n={t:"rangePoints",a:arguments},l},l.rangeRoundPoints=function(t,e){arguments.length<2&&(e=0);var a=t[0],c=t[1],u=r.length<2?(a=c=Math.round((a+c)/2),0):(c-a)/(r.length-1+e)|0;return i=s(a+Math.round(u*e/2+(c-a-(r.length-1+e)*u)/2),u),o=0,n={t:"rangeRoundPoints",a:arguments},l},l.rangeBands=function(t,e,a){arguments.length<2&&(e=0),arguments.length<3&&(a=e);var c=t[1]<t[0],u=t[c-0],f=t[1-c],d=(f-u)/(r.length-e+2*a);return i=s(u+d*a,d),c&&i.reverse(),o=d*(1-e),n={t:"rangeBands",a:arguments},l},l.rangeRoundBands=function(t,e,a){arguments.length<2&&(e=0),arguments.length<3&&(a=e);var c=t[1]<t[0],u=t[c-0],f=t[1-c],d=Math.floor((f-u)/(r.length-e+2*a));return i=s(u+Math.round((f-u-(r.length-e)*d)/2),d),c&&i.reverse(),o=Math.round(d*(1-e)),n={t:"rangeRoundBands",a:arguments},l},l.rangeBand=function(){return o},l.rangeExtent=function(){return go(n.a[0])},l.copy=function(){return e(r,n)},l.domain(r)}([],{t:"range",a:[[]]})},t.scale.category10=function(){return t.scale.ordinal().range(zo)},t.scale.category20=function(){return t.scale.ordinal().range(Po)},t.scale.category20b=function(){return t.scale.ordinal().range(Eo)},t.scale.category20c=function(){return t.scale.ordinal().range(Io)};var zo=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(ie),Po=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(ie),Eo=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(ie),Io=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(ie);function Ro(){return 0}t.scale.quantile=function(){return function e(r,n){var a;function i(){var e=0,i=n.length;for(a=[];++e<i;)a[e-1]=t.quantile(r,e/i);return o}function o(e){if(!isNaN(e=+e))return n[t.bisect(a,e)]}return o.domain=function(t){return arguments.length?(r=t.map(p).filter(h).sort(d),i()):r},o.range=function(t){return arguments.length?(n=t,i()):n},o.quantiles=function(){return a},o.invertExtent=function(t){return(t=n.indexOf(t))<0?[NaN,NaN]:[t>0?a[t-1]:r[0],t<a.length?a[t]:r[r.length-1]]},o.copy=function(){return e(r,n)},i()}([],[])},t.scale.quantize=function(){return function t(e,r,n){var a,i;function o(t){return n[Math.max(0,Math.min(i,Math.floor(a*(t-e))))]}function l(){return a=n.length/(r-e),i=n.length-1,o}return o.domain=function(t){return arguments.length?(e=+t[0],r=+t[t.length-1],l()):[e,r]},o.range=function(t){return arguments.length?(n=t,l()):n},o.invertExtent=function(t){return[t=(t=n.indexOf(t))<0?NaN:t/a+e,t+1/a]},o.copy=function(){return t(e,r,n)},l()}(0,1,[0,1])},t.scale.threshold=function(){return function e(r,n){function a(e){if(e<=e)return n[t.bisect(r,e)]}return a.domain=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=t,a):n},a.invertExtent=function(t){return t=n.indexOf(t),[r[t-1],r[t]]},a.copy=function(){return e(r,n)},a}([.5],[0,1])},t.scale.identity=function(){return function t(e){function r(t){return+t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=t.map(r),r):e},r.ticks=function(t){return Mo(e,t)},r.tickFormat=function(t,r){return Ao(e,t,r)},r.copy=function(){return t(e)},r}([0,1])},t.svg={},t.svg.arc=function(){var t=No,e=Bo,r=Ro,n=Fo,a=Ho,i=jo,o=Uo;function l(){var l=Math.max(0,+t.apply(this,arguments)),c=Math.max(0,+e.apply(this,arguments)),u=a.apply(this,arguments)-Ct,f=i.apply(this,arguments)-Ct,d=Math.abs(f-u),p=u>f?0:1;if(c<l&&(h=c,c=l,l=h),d>=St)return s(c,p)+(l?s(l,1-p):"")+"Z";var h,g,v,m,y,x,b,_,w,T,k,M,A=0,L=0,S=[];if((m=(+o.apply(this,arguments)||0)/2)&&(v=n===Fo?Math.sqrt(l*l+c*c):+n.apply(this,arguments),p||(L*=-1),c&&(L=It(v/c*Math.sin(m))),l&&(A=It(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)<=At?0:1;if(L&&Vo(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),T=l*Math.sin(f-A),k=l*Math.cos(u+A),M=l*Math.sin(u+A);var D=Math.abs(u-f+2*A)<=At?0:1;if(A&&Vo(w,T,k,M)===1-p^D){var z=(u+f)/2;w=l*Math.cos(z),T=l*Math.sin(z),k=M=null}}else w=T=0;if(d>kt&&(h=Math.min(Math.abs(c-l)/2,+r.apply(this,arguments)))>.001){g=l<c^p?0:1;var P=h,E=h;if(d<At){var I=null==k?[w,T]:null==b?[y,x]:sa([y,x],[k,M],[b,_],[w,T]),R=y-I[0],F=x-I[1],N=b-I[0],B=_-I[1],H=1/Math.sin(Math.acos((R*N+F*B)/(Math.sqrt(R*R+F*F)*Math.sqrt(N*N+B*B)))/2),j=Math.sqrt(I[0]*I[0]+I[1]*I[1]);E=Math.min(h,(l-j)/(H-1)),P=Math.min(h,(c-j)/(H+1))}if(null!=b){var U=qo(null==k?[w,T]:[k,M],[y,x],c,P,p),V=qo([b,_],[w,T],c,P,p);h===P?S.push("M",U[0],"A",P,",",P," 0 0,",g," ",U[1],"A",c,",",c," 0 ",1-p^Vo(U[1][0],U[1][1],V[1][0],V[1][1]),",",p," ",V[1],"A",P,",",P," 0 0,",g," ",V[0]):S.push("M",U[0],"A",P,",",P," 0 1,",g," ",V[0])}else S.push("M",y,",",x);if(null!=k){var q=qo([y,x],[k,M],l,-E,p),G=qo([w,T],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^Vo(G[1][0],G[1][1],q[1][0],q[1][1]),",",1-p," ",q[1],"A",E,",",E," 0 0,",g," ",q[0]):S.push("L",G[0],"A",E,",",E," 0 0,",g," ",q[0])}else S.push("L",w,",",T)}else S.push("M",y,",",x),null!=b&&S.push("A",c,",",c," 0 ",C,",",p," ",b,",",_),S.push("L",w,",",T),null!=k&&S.push("A",l,",",l," 0 ",D,",",1-p," ",k,",",M);return S.push("Z"),S.join("")}function s(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}return l.innerRadius=function(e){return arguments.length?(t=he(e),l):t},l.outerRadius=function(t){return arguments.length?(e=he(t),l):e},l.cornerRadius=function(t){return arguments.length?(r=he(t),l):r},l.padRadius=function(t){return arguments.length?(n=t==Fo?Fo:he(t),l):n},l.startAngle=function(t){return arguments.length?(a=he(t),l):a},l.endAngle=function(t){return arguments.length?(i=he(t),l):i},l.padAngle=function(t){return arguments.length?(o=he(t),l):o},l.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+a.apply(this,arguments)+ +i.apply(this,arguments))/2-Ct;return[Math.cos(n)*r,Math.sin(n)*r]},l};var Fo="auto";function No(t){return t.innerRadius}function Bo(t){return t.outerRadius}function Ho(t){return t.startAngle}function jo(t){return t.endAngle}function Uo(t){return t&&t.padAngle}function Vo(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function qo(t,e,r,n,a){var i=t[0]-e[0],o=t[1]-e[1],l=(a?n:-n)/Math.sqrt(i*i+o*o),s=l*o,c=-l*i,u=t[0]+s,f=t[1]+c,d=e[0]+s,p=e[1]+c,h=(u+d)/2,g=(f+p)/2,v=d-u,m=p-f,y=v*v+m*m,x=r-n,b=u*p-d*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*m-v*_)/y,T=(-b*v-m*_)/y,k=(b*m+v*_)/y,M=(-b*v+m*_)/y,A=w-h,L=T-g,S=k-h,C=M-g;return A*A+L*L>S*S+C*C&&(w=k,T=M),[[w-s,T-c],[w*r/x,T*r/x]]}function Go(t){var e=ra,r=na,n=Zr,a=Yo,i=a.key,o=.7;function l(i){var l,s=[],c=[],u=-1,f=i.length,d=he(e),p=he(r);function h(){s.push("M",a(t(c),o))}for(;++u<f;)n.call(this,l=i[u],u)?c.push([+d.call(this,l,u),+p.call(this,l,u)]):c.length&&(h(),c=[]);return c.length&&h(),s.length?s.join(""):null}return l.x=function(t){return arguments.length?(e=t,l):e},l.y=function(t){return arguments.length?(r=t,l):r},l.defined=function(t){return arguments.length?(n=t,l):n},l.interpolate=function(t){return arguments.length?(i="function"==typeof t?a=t:(a=Zo.get(t)||Yo).key,l):i},l.tension=function(t){return arguments.length?(o=t,l):o},l}t.svg.line=function(){return Go(O)};var Zo=t.map({linear:Yo,"linear-closed":Xo,step:function(t){var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];for(;++e<r;)a.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);r>1&&a.push("H",n[0]);return a.join("")},"step-before":Wo,"step-after":Qo,basis:Ko,"basis-open":function(t){if(t.length<4)return Yo(t);var e,r=[],n=-1,a=t.length,i=[0],o=[0];for(;++n<3;)e=t[n],i.push(e[0]),o.push(e[1]);r.push(tl(nl,i)+","+tl(nl,o)),--n;for(;++n<a;)e=t[n],i.shift(),i.push(e[0]),o.shift(),o.push(e[1]),al(r,i,o);return r.join("")},"basis-closed":function(t){var e,r,n=-1,a=t.length,i=a+4,o=[],l=[];for(;++n<4;)r=t[n%a],o.push(r[0]),l.push(r[1]);e=[tl(nl,o),",",tl(nl,l)],--n;for(;++n<i;)r=t[n%a],o.shift(),o.push(r[0]),l.shift(),l.push(r[1]),al(e,o,l);return e.join("")},bundle:function(t,e){var r=t.length-1;if(r)for(var n,a,i=t[0][0],o=t[0][1],l=t[r][0]-i,s=t[r][1]-o,c=-1;++c<=r;)n=t[c],a=c/r,n[0]=e*n[0]+(1-e)*(i+a*l),n[1]=e*n[1]+(1-e)*(o+a*s);return Ko(t)},cardinal:function(t,e){return t.length<3?Yo(t):t[0]+Jo(t,$o(t,e))},"cardinal-open":function(t,e){return t.length<4?Yo(t):t[1]+Jo(t.slice(1,-1),$o(t,e))},"cardinal-closed":function(t,e){return t.length<3?Xo(t):t[0]+Jo((t.push(t[0]),t),$o([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?Yo(t):t[0]+Jo(t,function(t){var e,r,n,a,i=[],o=function(t){var e=0,r=t.length-1,n=[],a=t[0],i=t[1],o=n[0]=il(a,i);for(;++e<r;)n[e]=(o+(o=il(a=i,i=t[e+1])))/2;return n[e]=o,n}(t),l=-1,s=t.length-1;for(;++l<s;)e=il(t[l],t[l+1]),y(e)<kt?o[l]=o[l+1]=0:(r=o[l]/e,n=o[l+1]/e,(a=r*r+n*n)>9&&(a=3*e/Math.sqrt(a),o[l]=a*r,o[l+1]=a*n));l=-1;for(;++l<=s;)a=(t[Math.min(s,l+1)][0]-t[Math.max(0,l-1)][0])/(6*(1+o[l]*o[l])),i.push([a||0,o[l]*a||0]);return i}(t))}});function Yo(t){return t.length>1?t.join("L"):t+"Z"}function Xo(t){return t.join("L")+"Z"}function Wo(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("V",(n=t[e])[1],"H",n[0]);return a.join("")}function Qo(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("H",(n=t[e])[0],"V",n[1]);return a.join("")}function Jo(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return Yo(t);var r=t.length!=e.length,n="",a=t[0],i=t[1],o=e[0],l=o,s=1;if(r&&(n+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],a=t[1],s=2),e.length>1){l=e[1],i=t[s],s++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-l[0])+","+(i[1]-l[1])+","+i[0]+","+i[1];for(var c=2;c<e.length;c++,s++)i=t[s],l=e[c],n+="S"+(i[0]-l[0])+","+(i[1]-l[1])+","+i[0]+","+i[1]}if(r){var u=t[s];n+="Q"+(i[0]+2*l[0]/3)+","+(i[1]+2*l[1]/3)+","+u[0]+","+u[1]}return n}function $o(t,e){for(var r,n=[],a=(1-e)/2,i=t[0],o=t[1],l=1,s=t.length;++l<s;)r=i,i=o,o=t[l],n.push([a*(o[0]-r[0]),a*(o[1]-r[1])]);return n}function Ko(t){if(t.length<3)return Yo(t);var e=1,r=t.length,n=t[0],a=n[0],i=n[1],o=[a,a,a,(n=t[1])[0]],l=[i,i,i,n[1]],s=[a,",",i,"L",tl(nl,o),",",tl(nl,l)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),l.shift(),l.push(n[1]),al(s,o,l);return t.pop(),s.push("L",n),s.join("")}function tl(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}Zo.forEach((function(t,e){e.key=t,e.closed=/-closed$/.test(t)}));var el=[0,2/3,1/3,0],rl=[0,1/3,2/3,0],nl=[0,1/6,2/3,1/6];function al(t,e,r){t.push("C",tl(el,e),",",tl(el,r),",",tl(rl,e),",",tl(rl,r),",",tl(nl,e),",",tl(nl,r))}function il(t,e){return(e[1]-t[1])/(e[0]-t[0])}function ol(t){for(var e,r,n,a=-1,i=t.length;++a<i;)r=(e=t[a])[0],n=e[1]-Ct,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function ll(t){var e=ra,r=ra,n=0,a=na,i=Zr,o=Yo,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=he(e),b=he(n),_=e===r?function(){return d}:he(r),w=n===a?function(){return p}:he(a);function T(){h.push("M",o(t(v),u),c,s(t(g.reverse()),u),"Z")}for(;++m<y;)i.call(this,f=l[m],m)?(g.push([d=+x.call(this,f,m),p=+b.call(this,f,m)]),v.push([+_.call(this,f,m),+w.call(this,f,m)])):g.length&&(T(),g=[],v=[]);return g.length&&T(),h.length?h.join(""):null}return f.x=function(t){return arguments.length?(e=r=t,f):r},f.x0=function(t){return arguments.length?(e=t,f):e},f.x1=function(t){return arguments.length?(r=t,f):r},f.y=function(t){return arguments.length?(n=a=t,f):a},f.y0=function(t){return arguments.length?(n=t,f):n},f.y1=function(t){return arguments.length?(a=t,f):a},f.defined=function(t){return arguments.length?(i=t,f):i},f.interpolate=function(t){return arguments.length?(l="function"==typeof t?o=t:(o=Zo.get(t)||Yo).key,s=o.reverse||o,c=o.closed?"M":"L",f):l},f.tension=function(t){return arguments.length?(u=t,f):u},f}function sl(t){return t.radius}function cl(t){return[t.x,t.y]}function ul(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Ct;return[r*Math.cos(n),r*Math.sin(n)]}}function fl(){return 64}function dl(){return"circle"}function pl(t){var e=Math.sqrt(t/At);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}t.svg.line.radial=function(){var t=Go(ol);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Wo.reverse=Qo,Qo.reverse=Wo,t.svg.area=function(){return ll(O)},t.svg.area.radial=function(){var t=ll(ol);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},t.svg.chord=function(){var t=Un,e=Vn,r=sl,n=Ho,a=jo;function i(r,n){var a,i,c=o(this,t,r,n),u=o(this,e,r,n);return"M"+c.p0+l(c.r,c.p1,c.a1-c.a0)+(i=u,((a=c).a0==i.a0&&a.a1==i.a1?s(c.r,c.p1,c.r,c.p0):s(c.r,c.p1,u.r,u.p0)+l(u.r,u.p1,u.a1-u.a0)+s(u.r,u.p1,c.r,c.p0))+"Z")}function o(t,e,i,o){var l=e.call(t,i,o),s=r.call(t,l,o),c=n.call(t,l,o)-Ct,u=a.call(t,l,o)-Ct;return{r:s,a0:c,a1:u,p0:[s*Math.cos(c),s*Math.sin(c)],p1:[s*Math.cos(u),s*Math.sin(u)]}}function l(t,e,r){return"A"+t+","+t+" 0 "+ +(r>At)+",1 "+e}function s(t,e,r,n){return"Q 0,0 "+n}return i.radius=function(t){return arguments.length?(r=he(t),i):r},i.source=function(e){return arguments.length?(t=he(e),i):t},i.target=function(t){return arguments.length?(e=he(t),i):e},i.startAngle=function(t){return arguments.length?(n=he(t),i):n},i.endAngle=function(t){return arguments.length?(a=he(t),i):a},i},t.svg.diagonal=function(){var t=Un,e=Vn,r=cl;function n(n,a){var i=t.call(this,n,a),o=e.call(this,n,a),l=(i.y+o.y)/2,s=[i,{x:i.x,y:l},{x:o.x,y:l},o];return"M"+(s=s.map(r))[0]+"C"+s[1]+" "+s[2]+" "+s[3]}return n.source=function(e){return arguments.length?(t=he(e),n):t},n.target=function(t){return arguments.length?(e=he(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=cl,n=e.projection;return e.projection=function(t){return arguments.length?n(ul(r=t)):r},e},t.svg.symbol=function(){var t=dl,e=fl;function r(r,n){return(hl.get(t.call(this,r,n))||pl)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=he(e),r):t},r.size=function(t){return arguments.length?(e=he(t),r):e},r};var hl=t.map({circle:pl,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*vl)),r=e*vl;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/gl),r=e*gl/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/gl),r=e*gl/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=hl.keys();var gl=Math.sqrt(3),vl=Math.tan(30*Ot);Z.transition=function(t){for(var e,r,n=bl||++Tl,a=Al(t),i=[],o=_l||{time:Date.now(),ease:ci,delay:0,duration:250},l=-1,s=this.length;++l<s;){i.push(e=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(r=c[u])&&Ll(r,u,a,n,o),e.push(r)}return xl(i,a,n)},Z.interrupt=function(t){return this.each(null==t?ml:yl(Al(t)))};var ml=yl(Al());function yl(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=NaN,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function xl(t,e,r){return j(t,wl),t.namespace=e,t.id=r,t}var bl,_l,wl=[],Tl=0;function kl(t,e,r,n){var a=t.id,i=t.namespace;return ut(t,"function"==typeof r?function(t,o,l){t[i][a].tween.set(e,n(r.call(t,t.__data__,o,l)))}:(r=n(r),function(t){t[i][a].tween.set(e,r)}))}function Ml(t){return null==t&&(t=""),function(){this.textContent=t}}function Al(t){return null==t?"__transition__":"__transition_"+t+"__"}function Ll(t,e,r,n,a){var i,o,l,s,c,u=t[r]||(t[r]={active:0,count:0}),f=u[n];function d(r){var a=u.active,d=u[a];for(var h in d&&(d.timer.c=null,d.timer.t=NaN,--u.count,delete u[a],d.event&&d.event.interrupt.call(t,t.__data__,d.index)),u)if(+h<n){var g=u[h];g.timer.c=null,g.timer.t=NaN,--u.count,delete u[h]}o.c=p,we((function(){return o.c&&p(r||1)&&(o.c=null,o.t=NaN),1}),0,i),u.active=n,f.event&&f.event.start.call(t,t.__data__,e),c=[],f.tween.forEach((function(r,n){(n=n.call(t,t.__data__,e))&&c.push(n)})),s=f.ease,l=f.duration}function p(a){for(var i=a/l,o=s(i),d=c.length;d>0;)c[--d].call(t,o);if(i>=1)return f.event&&f.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}f||(i=a.time,o=we((function(t){var e=f.delay;if(o.t=e+i,e<=t)return d(t-e);o.c=d}),0,i),f=u[n]={tween:new _,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++u.count)}wl.call=Z.call,wl.empty=Z.empty,wl.node=Z.node,wl.size=Z.size,t.transition=function(e,r){return e&&e.transition?bl?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=wl,wl.select=function(t){var e,r,n,a=this.id,i=this.namespace,o=[];t=Y(t);for(var l=-1,s=this.length;++l<s;){o.push(e=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(n=c[u])&&(r=t.call(n,n.__data__,u,l))?("__data__"in n&&(r.__data__=n.__data__),Ll(r,u,i,a,n[i][a]),e.push(r)):e.push(null)}return xl(o,i,a)},wl.selectAll=function(t){var e,r,n,a,i,o=this.id,l=this.namespace,s=[];t=X(t);for(var c=-1,u=this.length;++c<u;)for(var f=this[c],d=-1,p=f.length;++d<p;)if(n=f[d]){i=n[l][o],r=t.call(n,n.__data__,d,c),s.push(e=[]);for(var h=-1,g=r.length;++h<g;)(a=r[h])&&Ll(a,h,l,o,i),e.push(a)}return xl(s,l,o)},wl.filter=function(t){var e,r,n=[];"function"!=typeof t&&(t=st(t));for(var a=0,i=this.length;a<i;a++){n.push(e=[]);for(var o,l=0,s=(o=this[a]).length;l<s;l++)(r=o[l])&&t.call(r,r.__data__,l,a)&&e.push(r)}return xl(n,this.namespace,this.id)},wl.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):ut(this,null==e?function(e){e[n][r].tween.remove(t)}:function(a){a[n][r].tween.set(t,e)})},wl.attr=function(e,r){if(arguments.length<2){for(r in e)this.attr(r,e[r]);return this}var n="transform"==e?bi:Ka,a=t.ns.qualify(e);function i(){this.removeAttribute(a)}function o(){this.removeAttributeNS(a.space,a.local)}function l(t){return null==t?i:(t+="",function(){var e,r=this.getAttribute(a);return r!==t&&(e=n(r,t),function(t){this.setAttribute(a,e(t))})})}function s(t){return null==t?o:(t+="",function(){var e,r=this.getAttributeNS(a.space,a.local);return r!==t&&(e=n(r,t),function(t){this.setAttributeNS(a.space,a.local,e(t))})})}return kl(this,"attr."+e,r,a.local?s:l)},wl.attrTween=function(e,r){var n=t.ns.qualify(e);return this.tween("attr."+e,n.local?function(t,e){var a=r.call(this,t,e,this.getAttributeNS(n.space,n.local));return a&&function(t){this.setAttributeNS(n.space,n.local,a(t))}}:function(t,e){var a=r.call(this,t,e,this.getAttribute(n));return a&&function(t){this.setAttribute(n,a(t))}})},wl.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.style(r,t[r],e);return this}r=""}function a(){this.style.removeProperty(t)}function i(e){return null==e?a:(e+="",function(){var n,a=o(this).getComputedStyle(this,null).getPropertyValue(t);return a!==e&&(n=Ka(a,e),function(e){this.style.setProperty(t,n(e),r)})})}return kl(this,"style."+t,e,i)},wl.styleTween=function(t,e,r){function n(n,a){var i=e.call(this,n,a,o(this).getComputedStyle(this,null).getPropertyValue(t));return i&&function(e){this.style.setProperty(t,i(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,n)},wl.text=function(t){return kl(this,"text",t,Ml)},wl.remove=function(){var t=this.namespace;return this.each("end.transition",(function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)}))},wl.ease=function(e){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:("function"!=typeof e&&(e=t.ease.apply(t,arguments)),ut(this,(function(t){t[n][r].ease=e})))},wl.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:ut(this,"function"==typeof t?function(n,a,i){n[r][e].delay=+t.call(n,n.__data__,a,i)}:(t=+t,function(n){n[r][e].delay=t}))},wl.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:ut(this,"function"==typeof t?function(n,a,i){n[r][e].duration=Math.max(1,t.call(n,n.__data__,a,i))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},wl.each=function(e,r){var n=this.id,a=this.namespace;if(arguments.length<2){var i=_l,o=bl;try{bl=n,ut(this,(function(t,r,i){_l=t[a][n],e.call(t,t.__data__,r,i)}))}finally{_l=i,bl=o}}else ut(this,(function(i){var o=i[a][n];(o.event||(o.event=t.dispatch("start","end","interrupt"))).on(e,r)}));return this},wl.transition=function(){for(var t,e,r,n=this.id,a=++Tl,i=this.namespace,o=[],l=0,s=this.length;l<s;l++){o.push(t=[]);for(var c,u=0,f=(c=this[l]).length;u<f;u++)(e=c[u])&&Ll(e,u,i,a,{time:(r=e[i][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),t.push(e)}return xl(o,i,a)},t.svg.axis=function(){var e,r=t.scale.linear(),a=Sl,i=6,o=6,l=3,s=[10],c=null;function u(n){n.each((function(){var n,u=t.select(this),f=this.__chart__||r,d=this.__chart__=r.copy(),p=null==c?d.ticks?d.ticks.apply(d,s):d.domain():c,h=null==e?d.tickFormat?d.tickFormat.apply(d,s):O:e,g=u.selectAll(".tick").data(p,d),v=g.enter().insert("g",".domain").attr("class","tick").style("opacity",kt),m=t.transition(g.exit()).style("opacity",kt).remove(),y=t.transition(g.order()).style("opacity",1),x=Math.max(i,0)+l,b=vo(d),_=u.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),t.transition(_));v.append("line"),v.append("text");var T,k,M,A,L=v.select("line"),S=y.select("line"),C=g.select("text").text(h),D=v.select("text"),z=y.select("text"),P="top"===a||"left"===a?-1:1;if("bottom"===a||"top"===a?(n=Ol,T="x",M="y",k="x2",A="y2",C.attr("dy",P<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+b[0]+","+P*o+"V0H"+b[1]+"V"+P*o)):(n=Dl,T="y",M="x",k="y2",A="x2",C.attr("dy",".32em").style("text-anchor",P<0?"end":"start"),w.attr("d","M"+P*o+","+b[0]+"H0V"+b[1]+"H"+P*o)),L.attr(A,P*i),D.attr(M,P*x),S.attr(k,0).attr(A,P*i),z.attr(T,0).attr(M,P*x),d.rangeBand){var E=d,I=E.rangeBand()/2;f=d=function(t){return E(t)+I}}else f.rangeBand?f=d:m.call(n,d,f);v.call(n,f,d),y.call(n,d,d)}))}return u.scale=function(t){return arguments.length?(r=t,u):r},u.orient=function(t){return arguments.length?(a=t in Cl?t+"":Sl,u):a},u.ticks=function(){return arguments.length?(s=n(arguments),u):s},u.tickValues=function(t){return arguments.length?(c=t,u):c},u.tickFormat=function(t){return arguments.length?(e=t,u):e},u.tickSize=function(t){var e=arguments.length;return e?(i=+t,o=+arguments[e-1],u):i},u.innerTickSize=function(t){return arguments.length?(i=+t,u):i},u.outerTickSize=function(t){return arguments.length?(o=+t,u):o},u.tickPadding=function(t){return arguments.length?(l=+t,u):l},u.tickSubdivide=function(){return arguments.length&&u},u};var Sl="bottom",Cl={top:1,right:1,bottom:1,left:1};function Ol(t,e,r){t.attr("transform",(function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"}))}function Dl(t,e,r){t.attr("transform",(function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"}))}t.svg.brush=function(){var e,r,n=B(d,"brushstart","brush","brushend"),a=null,i=null,l=[0,0],s=[0,0],c=!0,u=!0,f=Pl[0];function d(e){e.each((function(){var e=t.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",v).on("touchstart.brush",v),r=e.selectAll(".background").data([0]);r.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),e.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=e.selectAll(".resize").data(f,O);n.exit().remove(),n.enter().append("g").attr("class",(function(t){return"resize "+t})).style("cursor",(function(t){return zl[t]})).append("rect").attr("x",(function(t){return/[ew]$/.test(t)?-3:null})).attr("y",(function(t){return/^[ns]/.test(t)?-3:null})).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",d.empty()?"none":null);var o,l=t.transition(e),s=t.transition(r);a&&(o=vo(a),s.attr("x",o[0]).attr("width",o[1]-o[0]),h(l)),i&&(o=vo(i),s.attr("y",o[0]).attr("height",o[1]-o[0]),g(l)),p(l)}))}function p(t){t.selectAll(".resize").attr("transform",(function(t){return"translate("+l[+/e$/.test(t)]+","+s[+/^s/.test(t)]+")"}))}function h(t){t.select(".extent").attr("x",l[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function g(t){t.select(".extent").attr("y",s[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function v(){var f,v,m=this,y=t.select(t.event.target),x=n.of(m,arguments),b=t.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&a,T=!/^(e|w)$/.test(_)&&i,k=y.classed("extent"),M=bt(m),A=t.mouse(m),L=t.select(o(m)).on("keydown.brush",O).on("keyup.brush",D);if(t.event.changedTouches?L.on("touchmove.brush",z).on("touchend.brush",E):L.on("mousemove.brush",z).on("mouseup.brush",E),b.interrupt().selectAll("*").interrupt(),k)A[0]=l[0]-A[0],A[1]=s[0]-A[1];else if(_){var S=+/w$/.test(_),C=+/^n/.test(_);v=[l[1-S]-A[0],s[1-C]-A[1]],A[0]=l[S],A[1]=s[C]}else t.event.altKey&&(f=A.slice());function O(){32==t.event.keyCode&&(k||(f=null,A[0]-=l[1],A[1]-=s[1],k=2),F())}function D(){32==t.event.keyCode&&2==k&&(A[0]+=l[1],A[1]+=s[1],k=0,F())}function z(){var e=t.mouse(m),r=!1;v&&(e[0]+=v[0],e[1]+=v[1]),k||(t.event.altKey?(f||(f=[(l[0]+l[1])/2,(s[0]+s[1])/2]),A[0]=l[+(e[0]<f[0])],A[1]=s[+(e[1]<f[1])]):f=null),w&&P(e,a,0)&&(h(b),r=!0),T&&P(e,i,1)&&(g(b),r=!0),r&&(p(b),x({type:"brush",mode:k?"move":"resize"}))}function P(t,n,a){var i,o,d=vo(n),p=d[0],h=d[1],g=A[a],v=a?s:l,m=v[1]-v[0];if(k&&(p-=g,h-=m+g),i=(a?u:c)?Math.max(p,Math.min(h,t[a])):t[a],k?o=(i+=g)+m:(f&&(g=Math.max(p,Math.min(h,2*f[a]-i))),g<i?(o=i,i=g):o=g),v[0]!=i||v[1]!=o)return a?r=null:e=null,v[0]=i,v[1]=o,!0}function E(){z(),b.style("pointer-events","all").selectAll(".resize").style("display",d.empty()?"none":null),t.select("body").style("cursor",null),L.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),M(),x({type:"brushend"})}b.style("pointer-events","none").selectAll(".resize").style("display",null),t.select("body").style("cursor",y.style("cursor")),x({type:"brushstart"}),z()}return d.event=function(a){a.each((function(){var a=n.of(this,arguments),i={x:l,y:s,i:e,j:r},o=this.__chart__||i;this.__chart__=i,bl?t.select(this).transition().each("start.brush",(function(){e=o.i,r=o.j,l=o.x,s=o.y,a({type:"brushstart"})})).tween("brush:brush",(function(){var t=ti(l,i.x),n=ti(s,i.y);return e=r=null,function(e){l=i.x=t(e),s=i.y=n(e),a({type:"brush",mode:"resize"})}})).each("end.brush",(function(){e=i.i,r=i.j,a({type:"brush",mode:"resize"}),a({type:"brushend"})})):(a({type:"brushstart"}),a({type:"brush",mode:"resize"}),a({type:"brushend"}))}))},d.x=function(t){return arguments.length?(f=Pl[!(a=t)<<1|!i],d):a},d.y=function(t){return arguments.length?(f=Pl[!a<<1|!(i=t)],d):i},d.clamp=function(t){return arguments.length?(a&&i?(c=!!t[0],u=!!t[1]):a?c=!!t:i&&(u=!!t),d):a&&i?[c,u]:a?c:i?u:null},d.extent=function(t){var n,o,c,u,f;return arguments.length?(a&&(n=t[0],o=t[1],i&&(n=n[0],o=o[0]),e=[n,o],a.invert&&(n=a(n),o=a(o)),o<n&&(f=n,n=o,o=f),n==l[0]&&o==l[1]||(l=[n,o])),i&&(c=t[0],u=t[1],a&&(c=c[1],u=u[1]),r=[c,u],i.invert&&(c=i(c),u=i(u)),u<c&&(f=c,c=u,u=f),c==s[0]&&u==s[1]||(s=[c,u])),d):(a&&(e?(n=e[0],o=e[1]):(n=l[0],o=l[1],a.invert&&(n=a.invert(n),o=a.invert(o)),o<n&&(f=n,n=o,o=f))),i&&(r?(c=r[0],u=r[1]):(c=s[0],u=s[1],i.invert&&(c=i.invert(c),u=i.invert(u)),u<c&&(f=c,c=u,u=f))),a&&i?[[n,c],[o,u]]:a?[n,o]:i&&[c,u])},d.clear=function(){return d.empty()||(l=[0,0],s=[0,0],e=r=null),d},d.empty=function(){return!!a&&l[0]==l[1]||!!i&&s[0]==s[1]},t.rebind(d,n,"on")};var zl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Pl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],El=ze.format=lr.timeFormat,Il=El.utc,Rl=Il("%Y-%m-%dT%H:%M:%S.%LZ");function Fl(t){return t.toISOString()}function Nl(e,r,n){function a(t){return e(t)}function i(e,n){var a=(e[1]-e[0])/n,i=t.bisect(Hl,a);return i==Hl.length?[r.year,ko(e.map((function(t){return t/31536e6})),n)[2]]:i?r[a/Hl[i-1]<Hl[i]/a?i-1:i]:[Vl,ko(e,n)[2]]}return a.invert=function(t){return Bl(e.invert(t))},a.domain=function(t){return arguments.length?(e.domain(t),a):e.domain().map(Bl)},a.nice=function(t,e){var r=a.domain(),n=go(r),o=null==t?i(n,10):"number"==typeof t&&i(n,t);function l(r){return!isNaN(r)&&!t.range(r,Bl(+r+1),e).length}return o&&(t=o[0],e=o[1]),a.domain(yo(r,e>1?{floor:function(e){for(;l(e=t.floor(e));)e=Bl(e-1);return e},ceil:function(e){for(;l(e=t.ceil(e));)e=Bl(+e+1);return e}}:t))},a.ticks=function(t,e){var r=go(a.domain()),n=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],Bl(+r[1]+1),e<1?1:e)},a.tickFormat=function(){return n},a.copy=function(){return Nl(e.copy(),r,n)},wo(a,e)}function Bl(t){return new Date(t)}El.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Fl:Rl,Fl.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Fl.toString=Rl.toString,ze.second=Re((function(t){return new Pe(1e3*Math.floor(t/1e3))}),(function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))}),(function(t){return t.getSeconds()})),ze.seconds=ze.second.range,ze.seconds.utc=ze.second.utc.range,ze.minute=Re((function(t){return new Pe(6e4*Math.floor(t/6e4))}),(function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))}),(function(t){return t.getMinutes()})),ze.minutes=ze.minute.range,ze.minutes.utc=ze.minute.utc.range,ze.hour=Re((function(t){var e=t.getTimezoneOffset()/60;return new Pe(36e5*(Math.floor(t/36e5-e)+e))}),(function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))}),(function(t){return t.getHours()})),ze.hours=ze.hour.range,ze.hours.utc=ze.hour.utc.range,ze.month=Re((function(t){return(t=ze.day(t)).setDate(1),t}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t){return t.getMonth()})),ze.months=ze.month.range,ze.months.utc=ze.month.utc.range;var Hl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],jl=[[ze.second,1],[ze.second,5],[ze.second,15],[ze.second,30],[ze.minute,1],[ze.minute,5],[ze.minute,15],[ze.minute,30],[ze.hour,1],[ze.hour,3],[ze.hour,6],[ze.hour,12],[ze.day,1],[ze.day,2],[ze.week,1],[ze.month,1],[ze.month,3],[ze.year,1]],Ul=El.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Zr]]),Vl={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Bl)},floor:O,ceil:O};jl.year=ze.year,ze.scale=function(){return Nl(t.scale.linear(),jl,Ul)};var ql=jl.map((function(t){return[t[0].utc,t[1]]})),Gl=Il.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Zr]]);function Zl(t){return JSON.parse(t.responseText)}function Yl(t){var e=a.createRange();return e.selectNode(a.body),e.createContextualFragment(t.responseText)}ql.year=ze.year.utc,ze.scale.utc=function(){return Nl(t.scale.linear(),ql,Gl)},t.text=ge((function(t){return t.responseText})),t.json=function(t,e){return ve(t,"application/json",Zl,e)},t.html=function(t,e){return ve(t,"text/html",Yl,e)},t.xml=ge((function(t){return t.responseXML})),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],22:[function(t,e,r){(function(n,a){(function(){
/*!
* @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(t,n){"object"==typeof r&&"undefined"!=typeof e?e.exports=n():t.ES6Promise=n()}(this,(function(){"use strict";function e(t){return"function"==typeof t}var r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,o=void 0,l=void 0,s=function(t,e){g[i]=t,g[i+1]=e,2===(i+=2)&&(l?l(v):_())};var c="undefined"!=typeof window?window:void 0,u=c||{},f=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&"undefined"!=typeof n&&"[object process]"==={}.toString.call(n),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var t=setTimeout;return function(){return t(v,1)}}var g=new Array(1e3);function v(){for(var t=0;t<i;t+=2){(0,g[t])(g[t+1]),g[t]=void 0,g[t+1]=void 0}i=0}var m,y,x,b,_=void 0;function w(t,e){var r=this,n=new this.constructor(M);void 0===n[k]&&I(n);var a=r._state;if(a){var i=arguments[a-1];s((function(){return P(a,n,i,r._result)}))}else D(r,n,t,e);return n}function T(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(M);return L(e,t),e}d?_=function(){return n.nextTick(v)}:f?(y=0,x=new f(v),b=document.createTextNode(""),x.observe(b,{characterData:!0}),_=function(){b.data=y=++y%2}):p?((m=new MessageChannel).port1.onmessage=v,_=function(){return m.port2.postMessage(0)}):_=void 0===c&&"function"==typeof t?function(){try{var t=Function("return this")().require("vertx");return"undefined"!=typeof(o=t.runOnLoop||t.runOnContext)?function(){o(v)}:h()}catch(t){return h()}}():h();var k=Math.random().toString(36).substring(2);function M(){}function A(t,r,n){r.constructor===t.constructor&&n===w&&r.constructor.resolve===T?function(t,e){1===e._state?C(t,e._result):2===e._state?O(t,e._result):D(e,void 0,(function(e){return L(t,e)}),(function(e){return O(t,e)}))}(t,r):void 0===n?C(t,r):e(n)?function(t,e,r){s((function(t){var n=!1,a=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,(function(r){n||(n=!0,e!==r?L(t,r):C(t,r))}),(function(e){n||(n=!0,O(t,e))}),t._label);!n&&a&&(n=!0,O(t,a))}),t)}(t,r,n):C(t,r)}function L(t,e){if(t===e)O(t,new TypeError("You cannot resolve a promise with itself"));else if(a=typeof(n=e),null===n||"object"!==a&&"function"!==a)C(t,e);else{var r=void 0;try{r=e.then}catch(e){return void O(t,e)}A(t,e,r)}var n,a}function S(t){t._onerror&&t._onerror(t._result),z(t)}function C(t,e){void 0===t._state&&(t._result=e,t._state=1,0!==t._subscribers.length&&s(z,t))}function O(t,e){void 0===t._state&&(t._state=2,t._result=e,s(S,t))}function D(t,e,r,n){var a=t._subscribers,i=a.length;t._onerror=null,a[i]=e,a[i+1]=r,a[i+2]=n,0===i&&t._state&&s(z,t)}function z(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,a=void 0,i=t._result,o=0;o<e.length;o+=3)n=e[o],a=e[o+r],n?P(r,n,a,i):a(i);t._subscribers.length=0}}function P(t,r,n,a){var i=e(n),o=void 0,l=void 0,s=!0;if(i){try{o=n(a)}catch(t){s=!1,l=t}if(r===o)return void O(r,new TypeError("A promises callback cannot return that same promise."))}else o=a;void 0!==r._state||(i&&s?L(r,o):!1===s?O(r,l):1===t?C(r,o):2===t&&O(r,o))}var E=0;function I(t){t[k]=E++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(M),this.promise[k]||I(this.promise),r(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?C(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&C(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;void 0===this._state&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===T){var a=void 0,i=void 0,o=!1;try{a=t.then}catch(t){o=!0,i=t}if(a===w&&void 0!==t._state)this._settledAt(t._state,e,t._result);else if("function"!=typeof a)this._remaining--,this._result[e]=t;else if(r===F){var l=new r(M);o?O(l,i):A(l,t,a),this._willSettleAt(l,e)}else this._willSettleAt(new r((function(e){return e(t)})),e)}else this._willSettleAt(n(t),e)},t.prototype._settledAt=function(t,e,r){var n=this.promise;void 0===n._state&&(this._remaining--,2===t?O(n,r):this._result[e]=r),0===this._remaining&&C(n,this._result)},t.prototype._willSettleAt=function(t,e){var r=this;D(t,void 0,(function(t){return r._settledAt(1,e,t)}),(function(t){return r._settledAt(2,e,t)}))},t}();var F=function(){function t(e){this[k]=E++,this._result=this._state=void 0,this._subscribers=[],M!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(t,e){try{e((function(e){L(t,e)}),(function(e){O(t,e)}))}catch(e){O(t,e)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.finally=function(t){var r=this.constructor;return e(t)?this.then((function(e){return r.resolve(t()).then((function(){return e}))}),(function(e){return r.resolve(t()).then((function(){throw e}))})):this.then(t,t)},t}();return F.prototype.then=w,F.all=function(t){return new R(this,t).promise},F.race=function(t){var e=this;return r(t)?new e((function(r,n){for(var a=t.length,i=0;i<a;i++)e.resolve(t[i]).then(r,n)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},F.resolve=T,F.reject=function(t){var e=new this(M);return O(e,t),e},F._setScheduler=function(t){l=t},F._setAsap=function(t){s=t},F._asap=s,F.polyfill=function(){var t=void 0;if("undefined"!=typeof a)t=a;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=F},F.Promise=F,F}))}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:87}],23:[function(t,e,r){"use strict";var n=t("is-string-blank");e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{"is-string-blank":75}],24:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],l=e[5],s=e[6],c=e[7],u=e[8],f=e[9],d=e[10],p=e[11],h=e[12],g=e[13],v=e[14],m=e[15];return t[0]=l*(d*m-p*v)-f*(s*m-c*v)+g*(s*p-c*d),t[1]=-(n*(d*m-p*v)-f*(a*m-i*v)+g*(a*p-i*d)),t[2]=n*(s*m-c*v)-l*(a*m-i*v)+g*(a*c-i*s),t[3]=-(n*(s*p-c*d)-l*(a*p-i*d)+f*(a*c-i*s)),t[4]=-(o*(d*m-p*v)-u*(s*m-c*v)+h*(s*p-c*d)),t[5]=r*(d*m-p*v)-u*(a*m-i*v)+h*(a*p-i*d),t[6]=-(r*(s*m-c*v)-o*(a*m-i*v)+h*(a*c-i*s)),t[7]=r*(s*p-c*d)-o*(a*p-i*d)+u*(a*c-i*s),t[8]=o*(f*m-p*g)-u*(l*m-c*g)+h*(l*p-c*f),t[9]=-(r*(f*m-p*g)-u*(n*m-i*g)+h*(n*p-i*f)),t[10]=r*(l*m-c*g)-o*(n*m-i*g)+h*(n*c-i*l),t[11]=-(r*(l*p-c*f)-o*(n*p-i*f)+u*(n*c-i*l)),t[12]=-(o*(f*v-d*g)-u*(l*v-s*g)+h*(l*d-s*f)),t[13]=r*(f*v-d*g)-u*(n*v-a*g)+h*(n*d-a*f),t[14]=-(r*(l*v-s*g)-o*(n*v-a*g)+h*(n*s-a*l)),t[15]=r*(l*d-s*f)-o*(n*d-a*f)+u*(n*s-a*l),t}},{}],25:[function(t,e,r){e.exports=function(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},{}],26:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},{}],27:[function(t,e,r){e.exports=function(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],28:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],a=t[3],i=t[4],o=t[5],l=t[6],s=t[7],c=t[8],u=t[9],f=t[10],d=t[11],p=t[12],h=t[13],g=t[14],v=t[15];return(e*o-r*i)*(f*v-d*g)-(e*l-n*i)*(u*v-d*h)+(e*s-a*i)*(u*g-f*h)+(r*l-n*o)*(c*v-d*p)-(r*s-a*o)*(c*g-f*p)+(n*s-a*l)*(c*h-u*p)}},{}],29:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=r+r,l=n+n,s=a+a,c=r*o,u=n*o,f=n*l,d=a*o,p=a*l,h=a*s,g=i*o,v=i*l,m=i*s;return t[0]=1-f-h,t[1]=u+m,t[2]=d-v,t[3]=0,t[4]=u-m,t[5]=1-c-h,t[6]=p+g,t[7]=0,t[8]=d+v,t[9]=p-g,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],30:[function(t,e,r){e.exports=function(t,e,r){var n,a,i,o=r[0],l=r[1],s=r[2],c=Math.sqrt(o*o+l*l+s*s);if(Math.abs(c)<1e-6)return null;return o*=c=1/c,l*=c,s*=c,n=Math.sin(e),a=Math.cos(e),i=1-a,t[0]=o*o*i+a,t[1]=l*o*i+s*n,t[2]=s*o*i-l*n,t[3]=0,t[4]=o*l*i-s*n,t[5]=l*l*i+a,t[6]=s*l*i+o*n,t[7]=0,t[8]=o*s*i+l*n,t[9]=l*s*i-o*n,t[10]=s*s*i+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],31:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3],l=n+n,s=a+a,c=i+i,u=n*l,f=n*s,d=n*c,p=a*s,h=a*c,g=i*c,v=o*l,m=o*s,y=o*c;return t[0]=1-(p+g),t[1]=f+y,t[2]=d-m,t[3]=0,t[4]=f-y,t[5]=1-(u+g),t[6]=h+v,t[7]=0,t[8]=d+m,t[9]=h-v,t[10]=1-(u+p),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}},{}],32:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],33:[function(t,e,r){e.exports=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}},{}],34:[function(t,e,r){e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],35:[function(t,e,r){e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],36:[function(t,e,r){e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],37:[function(t,e,r){e.exports=function(t,e,r,n,a,i,o){var l=1/(r-e),s=1/(a-n),c=1/(i-o);return t[0]=2*i*l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*i*s,t[6]=0,t[7]=0,t[8]=(r+e)*l,t[9]=(a+n)*s,t[10]=(o+i)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*i*2*c,t[15]=0,t}},{}],38:[function(t,e,r){e.exports=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],39:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),copy:t("./copy"),identity:t("./identity"),transpose:t("./transpose"),invert:t("./invert"),adjoint:t("./adjoint"),determinant:t("./determinant"),multiply:t("./multiply"),translate:t("./translate"),scale:t("./scale"),rotate:t("./rotate"),rotateX:t("./rotateX"),rotateY:t("./rotateY"),rotateZ:t("./rotateZ"),fromRotation:t("./fromRotation"),fromRotationTranslation:t("./fromRotationTranslation"),fromScaling:t("./fromScaling"),fromTranslation:t("./fromTranslation"),fromXRotation:t("./fromXRotation"),fromYRotation:t("./fromYRotation"),fromZRotation:t("./fromZRotation"),fromQuat:t("./fromQuat"),frustum:t("./frustum"),perspective:t("./perspective"),perspectiveFromFieldOfView:t("./perspectiveFromFieldOfView"),ortho:t("./ortho"),lookAt:t("./lookAt"),str:t("./str")}},{"./adjoint":24,"./clone":25,"./copy":26,"./create":27,"./determinant":28,"./fromQuat":29,"./fromRotation":30,"./fromRotationTranslation":31,"./fromScaling":32,"./fromTranslation":33,"./fromXRotation":34,"./fromYRotation":35,"./fromZRotation":36,"./frustum":37,"./identity":38,"./invert":40,"./lookAt":41,"./multiply":42,"./ortho":43,"./perspective":44,"./perspectiveFromFieldOfView":45,"./rotate":46,"./rotateX":47,"./rotateY":48,"./rotateZ":49,"./scale":50,"./str":51,"./translate":52,"./transpose":53}],40:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],l=e[5],s=e[6],c=e[7],u=e[8],f=e[9],d=e[10],p=e[11],h=e[12],g=e[13],v=e[14],m=e[15],y=r*l-n*o,x=r*s-a*o,b=r*c-i*o,_=n*s-a*l,w=n*c-i*l,T=a*c-i*s,k=u*g-f*h,M=u*v-d*h,A=u*m-p*h,L=f*v-d*g,S=f*m-p*g,C=d*m-p*v,O=y*C-x*S+b*L+_*A-w*M+T*k;if(!O)return null;return O=1/O,t[0]=(l*C-s*S+c*L)*O,t[1]=(a*S-n*C-i*L)*O,t[2]=(g*T-v*w+m*_)*O,t[3]=(d*w-f*T-p*_)*O,t[4]=(s*A-o*C-c*M)*O,t[5]=(r*C-a*A+i*M)*O,t[6]=(v*b-h*T-m*x)*O,t[7]=(u*T-d*b+p*x)*O,t[8]=(o*S-l*A+c*k)*O,t[9]=(n*A-r*S-i*k)*O,t[10]=(h*w-g*b+m*y)*O,t[11]=(f*b-u*w-p*y)*O,t[12]=(l*M-o*L-s*k)*O,t[13]=(r*L-n*M+a*k)*O,t[14]=(g*x-h*_-v*y)*O,t[15]=(u*_-f*x+d*y)*O,t}},{}],41:[function(t,e,r){var n=t("./identity");e.exports=function(t,e,r,a){var i,o,l,s,c,u,f,d,p,h,g=e[0],v=e[1],m=e[2],y=a[0],x=a[1],b=a[2],_=r[0],w=r[1],T=r[2];if(Math.abs(g-_)<1e-6&&Math.abs(v-w)<1e-6&&Math.abs(m-T)<1e-6)return n(t);f=g-_,d=v-w,p=m-T,h=1/Math.sqrt(f*f+d*d+p*p),i=x*(p*=h)-b*(d*=h),o=b*(f*=h)-y*p,l=y*d-x*f,(h=Math.sqrt(i*i+o*o+l*l))?(i*=h=1/h,o*=h,l*=h):(i=0,o=0,l=0);s=d*l-p*o,c=p*i-f*l,u=f*o-d*i,(h=Math.sqrt(s*s+c*c+u*u))?(s*=h=1/h,c*=h,u*=h):(s=0,c=0,u=0);return t[0]=i,t[1]=s,t[2]=f,t[3]=0,t[4]=o,t[5]=c,t[6]=d,t[7]=0,t[8]=l,t[9]=u,t[10]=p,t[11]=0,t[12]=-(i*g+o*v+l*m),t[13]=-(s*g+c*v+u*m),t[14]=-(f*g+d*v+p*m),t[15]=1,t}},{"./identity":38}],42:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3],l=e[4],s=e[5],c=e[6],u=e[7],f=e[8],d=e[9],p=e[10],h=e[11],g=e[12],v=e[13],m=e[14],y=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*l+_*f+w*g,t[1]=x*a+b*s+_*d+w*v,t[2]=x*i+b*c+_*p+w*m,t[3]=x*o+b*u+_*h+w*y,x=r[4],b=r[5],_=r[6],w=r[7],t[4]=x*n+b*l+_*f+w*g,t[5]=x*a+b*s+_*d+w*v,t[6]=x*i+b*c+_*p+w*m,t[7]=x*o+b*u+_*h+w*y,x=r[8],b=r[9],_=r[10],w=r[11],t[8]=x*n+b*l+_*f+w*g,t[9]=x*a+b*s+_*d+w*v,t[10]=x*i+b*c+_*p+w*m,t[11]=x*o+b*u+_*h+w*y,x=r[12],b=r[13],_=r[14],w=r[15],t[12]=x*n+b*l+_*f+w*g,t[13]=x*a+b*s+_*d+w*v,t[14]=x*i+b*c+_*p+w*m,t[15]=x*o+b*u+_*h+w*y,t}},{}],43:[function(t,e,r){e.exports=function(t,e,r,n,a,i,o){var l=1/(e-r),s=1/(n-a),c=1/(i-o);return t[0]=-2*l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*l,t[13]=(a+n)*s,t[14]=(o+i)*c,t[15]=1,t}},{}],44:[function(t,e,r){e.exports=function(t,e,r,n,a){var i=1/Math.tan(e/2),o=1/(n-a);return t[0]=i/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(a+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*a*n*o,t[15]=0,t}},{}],45:[function(t,e,r){e.exports=function(t,e,r,n){var a=Math.tan(e.upDegrees*Math.PI/180),i=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),l=Math.tan(e.rightDegrees*Math.PI/180),s=2/(o+l),c=2/(a+i);return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-l)*s*.5,t[9]=(a-i)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}},{}],46:[function(t,e,r){e.exports=function(t,e,r,n){var a,i,o,l,s,c,u,f,d,p,h,g,v,m,y,x,b,_,w,T,k,M,A,L,S=n[0],C=n[1],O=n[2],D=Math.sqrt(S*S+C*C+O*O);if(Math.abs(D)<1e-6)return null;S*=D=1/D,C*=D,O*=D,a=Math.sin(r),i=Math.cos(r),o=1-i,l=e[0],s=e[1],c=e[2],u=e[3],f=e[4],d=e[5],p=e[6],h=e[7],g=e[8],v=e[9],m=e[10],y=e[11],x=S*S*o+i,b=C*S*o+O*a,_=O*S*o-C*a,w=S*C*o-O*a,T=C*C*o+i,k=O*C*o+S*a,M=S*O*o+C*a,A=C*O*o-S*a,L=O*O*o+i,t[0]=l*x+f*b+g*_,t[1]=s*x+d*b+v*_,t[2]=c*x+p*b+m*_,t[3]=u*x+h*b+y*_,t[4]=l*w+f*T+g*k,t[5]=s*w+d*T+v*k,t[6]=c*w+p*T+m*k,t[7]=u*w+h*T+y*k,t[8]=l*M+f*A+g*L,t[9]=s*M+d*A+v*L,t[10]=c*M+p*A+m*L,t[11]=u*M+h*A+y*L,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t}},{}],47:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[4],o=e[5],l=e[6],s=e[7],c=e[8],u=e[9],f=e[10],d=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[4]=i*a+c*n,t[5]=o*a+u*n,t[6]=l*a+f*n,t[7]=s*a+d*n,t[8]=c*a-i*n,t[9]=u*a-o*n,t[10]=f*a-l*n,t[11]=d*a-s*n,t}},{}],48:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[0],o=e[1],l=e[2],s=e[3],c=e[8],u=e[9],f=e[10],d=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[0]=i*a-c*n,t[1]=o*a-u*n,t[2]=l*a-f*n,t[3]=s*a-d*n,t[8]=i*n+c*a,t[9]=o*n+u*a,t[10]=l*n+f*a,t[11]=s*n+d*a,t}},{}],49:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[0],o=e[1],l=e[2],s=e[3],c=e[4],u=e[5],f=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[0]=i*a+c*n,t[1]=o*a+u*n,t[2]=l*a+f*n,t[3]=s*a+d*n,t[4]=c*a-i*n,t[5]=u*a-o*n,t[6]=f*a-l*n,t[7]=d*a-s*n,t}},{}],50:[function(t,e,r){e.exports=function(t,e,r){var n=r[0],a=r[1],i=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},{}],51:[function(t,e,r){e.exports=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}},{}],52:[function(t,e,r){e.exports=function(t,e,r){var n,a,i,o,l,s,c,u,f,d,p,h,g=r[0],v=r[1],m=r[2];e===t?(t[12]=e[0]*g+e[4]*v+e[8]*m+e[12],t[13]=e[1]*g+e[5]*v+e[9]*m+e[13],t[14]=e[2]*g+e[6]*v+e[10]*m+e[14],t[15]=e[3]*g+e[7]*v+e[11]*m+e[15]):(n=e[0],a=e[1],i=e[2],o=e[3],l=e[4],s=e[5],c=e[6],u=e[7],f=e[8],d=e[9],p=e[10],h=e[11],t[0]=n,t[1]=a,t[2]=i,t[3]=o,t[4]=l,t[5]=s,t[6]=c,t[7]=u,t[8]=f,t[9]=d,t[10]=p,t[11]=h,t[12]=n*g+l*v+f*m+e[12],t[13]=a*g+s*v+d*m+e[13],t[14]=i*g+c*v+p*m+e[14],t[15]=o*g+u*v+h*m+e[15]);return t}},{}],53:[function(t,e,r){e.exports=function(t,e){if(t===e){var r=e[1],n=e[2],a=e[3],i=e[6],o=e[7],l=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[11]=e[14],t[12]=a,t[13]=o,t[14]=l}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}},{}],54:[function(t,e,r){(function(r){(function(){"use strict";var n,a=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,e.exports=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":73}],55:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":73}],56:[function(t,e,r){r.read=function(t,e,r,n,a){var i,o,l=8*a-n-1,s=(1<<l)-1,c=s>>1,u=-7,f=r?a-1:0,d=r?-1:1,p=t[e+f];for(f+=d,i=p&(1<<-u)-1,p>>=-u,u+=l;u>0;i=256*i+t[e+f],f+=d,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=d,u-=8);if(0===i)i=1-c;else{if(i===s)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),i-=c}return(p?-1:1)*o*Math.pow(2,i-n)},r.write=function(t,e,r,n,a,i){var o,l,s,c=8*i-a-1,u=(1<<c)-1,f=u>>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,h=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-o))<1&&(o--,s*=2),(e+=o+f>=1?d/s:d*Math.pow(2,1-f))*s>=2&&(o++,s/=2),o+f>=u?(l=0,o=u):o+f>=1?(l=(e*s-1)*Math.pow(2,a),o+=f):(l=e*Math.pow(2,f-1)*Math.pow(2,a),o=0));a>=8;t[r+p]=255&l,p+=h,l/=256,a-=8);for(o=o<<a|l,c+=a;c>0;t[r+p]=255&o,p+=h,o/=256,c-=8);t[r+p-h]|=128*g}},{}],57:[function(t,e,r){"use strict";var n=t("./types");e.exports=function(t,e){var r;for(r in n)if(n[r].detect(t,e))return r}},{"./types":60}],58:[function(t,e,r){(function(r){(function(){"use strict";var n=t("fs"),a=t("path"),i=t("./types"),o=t("./detector");function l(t,e){var r=o(t,e);if(r in i){var n=i[r].calculate(t,e);if(!1!==n)return n.type=r,n}throw new TypeError("unsupported file type: "+r+" (file: "+e+")")}e.exports=function(t,e){if(r.isBuffer(t))return l(t);if("string"!=typeof t)throw new TypeError("invalid invocation");var i=a.resolve(t);if("function"!=typeof e)return l(function(t){var e=n.openSync(t,"r"),a=n.fstatSync(e).size,i=Math.min(a,524288),o=r.alloc(i);return n.readSync(e,o,0,i,0),n.closeSync(e),o}(i),i);!function(t,e){n.open(t,"r",(function(a,i){if(a)return e(a);n.fstat(i,(function(a,o){if(a)return e(a);var l=o.size;if(l<=0)return e(new Error("File size is not greater than 0 \u2014\u2014 "+t));var s=Math.min(l,524288),c=r.alloc(s);n.read(i,c,0,s,0,(function(t){if(t)return e(t);n.close(i,(function(t){e(t,c)}))}))}))}))}(i,(function(t,r){if(t)return e(t);var n;try{n=l(r,i)}catch(e){t=e}e(t,n)}))},e.exports.types=Object.keys(i)}).call(this)}).call(this,t("buffer").Buffer)},{"./detector":57,"./types":60,buffer:18,fs:16,path:78}],59:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){return r=r||0,t["readUInt"+e+(n?"BE":"LE")].call(t,r)}},{}],60:[function(t,e,r){"use strict";var n={bmp:t("./types/bmp"),cur:t("./types/cur"),dds:t("./types/dds"),gif:t("./types/gif"),icns:t("./types/icns"),ico:t("./types/ico"),jpg:t("./types/jpg"),png:t("./types/png"),psd:t("./types/psd"),svg:t("./types/svg"),tiff:t("./types/tiff"),webp:t("./types/webp")};e.exports=n},{"./types/bmp":61,"./types/cur":62,"./types/dds":63,"./types/gif":64,"./types/icns":65,"./types/ico":66,"./types/jpg":67,"./types/png":68,"./types/psd":69,"./types/svg":70,"./types/tiff":71,"./types/webp":72}],61:[function(t,e,r){"use strict";e.exports={detect:function(t){return"BM"===t.toString("ascii",0,2)},calculate:function(t){return{width:t.readUInt32LE(18),height:Math.abs(t.readInt32LE(22))}}}},{}],62:[function(t,e,r){"use strict";e.exports={detect:function(t){return 0===t.readUInt16LE(0)&&2===t.readUInt16LE(2)},calculate:t("./ico").calculate}},{"./ico":66}],63:[function(t,e,r){"use strict";e.exports={detect:function(t){return 542327876===t.readUInt32LE(0)},calculate:function(t){return{height:t.readUInt32LE(12),width:t.readUInt32LE(16)}}}},{}],64:[function(t,e,r){"use strict";var n=/^GIF8[79]a/;e.exports={detect:function(t){var e=t.toString("ascii",0,6);return n.test(e)},calculate:function(t){return{width:t.readUInt16LE(6),height:t.readUInt16LE(8)}}}},{}],65:[function(t,e,r){"use strict";var n={ICON:32,"ICN#":32,"icm#":16,icm4:16,icm8:16,"ics#":16,ics4:16,ics8:16,is32:16,s8mk:16,icp4:16,icl4:32,icl8:32,il32:32,l8mk:32,icp5:32,ic11:32,ich4:48,ich8:48,ih32:48,h8mk:48,icp6:64,ic12:32,it32:128,t8mk:128,ic07:128,ic08:256,ic13:256,ic09:512,ic14:512,ic10:1024};function a(t,e){var r=e+4;return[t.toString("ascii",e,r),t.readUInt32BE(r)]}function i(t){var e=n[t];return{width:e,height:e,type:t}}e.exports={detect:function(t){return"icns"===t.toString("ascii",0,4)},calculate:function(t){var e,r,n,o=t.length,l=8,s=t.readUInt32BE(4);if(r=i((e=a(t,l))[0]),(l+=e[1])===s)return r;for(n={width:r.width,height:r.height,images:[r]};l<s&&l<o;)r=i((e=a(t,l))[0]),l+=e[1],n.images.push(r);return n}}},{}],66:[function(t,e,r){"use strict";function n(t,e){var r=t.readUInt8(e);return 0===r?256:r}function a(t,e){var r=6+16*e;return{width:n(t,r),height:n(t,r+1)}}e.exports={detect:function(t){return 0===t.readUInt16LE(0)&&1===t.readUInt16LE(2)},calculate:function(t){var e,r=t.readUInt16LE(4),n=a(t,0);if(1===r)return n;for(n.images=[{width:n.width,height:n.height}],e=1;e<r;e+=1)n.images.push(a(t,e));return n}}},{}],67:[function(t,e,r){"use strict";var n=t("../readUInt");function a(t){return"45786966"===t.toString("hex",2,6)}function i(t,e){return{height:t.readUInt16BE(e),width:t.readUInt16BE(e+2)}}function o(t,e){var r=t.slice(2,e),a=r.toString("hex",6,8),i="4d4d"===a;if(i||"4949"===a)return function(t,e){for(var r,a,i=n(t,16,14,e),o=0;o<i;o++){if(a=(r=16+12*o)+12,r>t.length)return;var l=t.slice(r,a);if(274===n(l,16,0,e)){if(3!==n(l,16,2,e))return;if(1!==n(l,32,4,e))return;return n(l,16,8,e)}}}(r,i)}function l(t,e){if(e>t.length)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(255!==t[e])throw new TypeError("Invalid JPG, marker table corrupted")}e.exports={detect:function(t){return"ffd8"===t.toString("hex",0,2)},calculate:function(t){var e,r,n;for(t=t.slice(4);t.length;){if(r=t.readUInt16BE(0),a(t)&&(e=o(t,r)),l(t,r),192===(n=t[r+1])||193===n||194===n){var s=i(t,r+5);return e?{width:s.width,height:s.height,orientation:e}:s}t=t.slice(r+2)}throw new TypeError("Invalid JPG, no size found")}}},{"../readUInt":59}],68:[function(t,e,r){"use strict";e.exports={detect:function(t){if("PNG\r\n\x1a\n"===t.toString("ascii",1,8)){var e=t.toString("ascii",12,16);if("CgBI"===e&&(e=t.toString("ascii",28,32)),"IHDR"!==e)throw new TypeError("invalid png");return!0}},calculate:function(t){return"CgBI"===t.toString("ascii",12,16)?{width:t.readUInt32BE(32),height:t.readUInt32BE(36)}:{width:t.readUInt32BE(16),height:t.readUInt32BE(20)}}}},{}],69:[function(t,e,r){"use strict";e.exports={detect:function(t){return"8BPS"===t.toString("ascii",0,4)},calculate:function(t){return{width:t.readUInt32BE(18),height:t.readUInt32BE(14)}}}},{}],70:[function(t,e,r){"use strict";var n=/<svg\s([^>"']|"[^"]*"|'[^']*')*>/;var a={root:n,width:/\swidth=(['"])([^%]+?)\1/,height:/\sheight=(['"])([^%]+?)\1/,viewbox:/\sviewBox=(['"])(.+?)\1/},i={cm:96/2.54,mm:96/2.54/10,m:96/2.54*100,pt:96/72,pc:96/72/12,em:16,ex:8};function o(t){var e=/([0-9.]+)([a-z]*)/.exec(t);if(e)return Math.round(parseFloat(e[1])*(i[e[2]]||1))}function l(t){var e=t.split(" ");return{width:o(e[2]),height:o(e[3])}}e.exports={detect:function(t){return n.test(t)},calculate:function(t){var e=t.toString("utf8").match(a.root);if(e){var r=function(t){var e=t.match(a.width),r=t.match(a.height),n=t.match(a.viewbox);return{width:e&&o(e[2]),height:r&&o(r[2]),viewbox:n&&l(n[2])}}(e[0]);if(r.width&&r.height)return function(t){return{width:t.width,height:t.height}}(r);if(r.viewbox)return function(t){var e=t.viewbox.width/t.viewbox.height;return t.width?{width:t.width,height:Math.floor(t.width/e)}:t.height?{width:Math.floor(t.height*e),height:t.height}:{width:t.viewbox.width,height:t.viewbox.height}}(r)}throw new TypeError("invalid svg")}}},{}],71:[function(t,e,r){(function(r){(function(){"use strict";var n=t("fs"),a=t("../readUInt");function i(t,e){var r=a(t,16,8,e);return(a(t,16,10,e)<<16)+r}function o(t){if(t.length>24)return t.slice(12)}e.exports={detect:function(t){var e=t.toString("hex",0,4);return"49492a00"===e||"4d4d002a"===e},calculate:function(t,e){if(!e)throw new TypeError("Tiff doesn't support buffer");var l="BE"===function(t){var e=t.toString("ascii",0,2);return"II"===e?"LE":"MM"===e?"BE":void 0}(t),s=function(t,e){for(var r,n,l,s={};t&&t.length&&(r=a(t,16,0,e),n=a(t,16,2,e),l=a(t,32,4,e),0!==r);)1!==l||3!==n&&4!==n||(s[r]=i(t,e)),t=o(t);return s}(function(t,e,i){var o=a(t,32,4,i),l=1024,s=n.statSync(e).size;o+l>s&&(l=s-o-10);var c=r.alloc(l),u=n.openSync(e,"r");return n.readSync(u,c,0,l,o),c.slice(2)}(t,e,l),l),c=s[256],u=s[257];if(!c||!u)throw new TypeError("Invalid Tiff, missing tags");return{width:c,height:u}}}}).call(this)}).call(this,t("buffer").Buffer)},{"../readUInt":59,buffer:18,fs:16}],72:[function(t,e,r){"use strict";e.exports={detect:function(t){var e="RIFF"===t.toString("ascii",0,4),r="WEBP"===t.toString("ascii",8,12),n="VP8"===t.toString("ascii",12,15);return e&&r&&n},calculate:function(t){var e=t.toString("ascii",12,16);if(t=t.slice(20,30),"VP8X"===e){var r=t[0];return!(!(0==(192&r))||!(0==(1&r)))&&function(t){return{width:1+t.readUIntLE(4,3),height:1+t.readUIntLE(7,3)}}(t)}if("VP8 "===e&&47!==t[0])return function(t){return{width:16383&t.readInt16LE(6),height:16383&t.readInt16LE(8)}}(t);var n=t.toString("hex",3,6);return"VP8L"===e&&"9d012a"!==n&&function(t){return{width:1+((63&t[2])<<8|t[1]),height:1+((15&t[4])<<10|t[3]<<2|(192&t[2])>>6)}}(t)}}},{}],73:[function(t,e,r){e.exports=!0},{}],74:[function(t,e,r){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var n=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,a=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function i(t){t||(t={});var e=t.ua;if(e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"!=typeof e)return!1;var r=t.tablet?a.test(e):n.test(e);return!r&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(r=!0),r}},{}],75:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},{}],76:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var a=t.clientX||0,i=t.clientY||0,o=(l=e,l===window||l===document||l===document.body?n:l.getBoundingClientRect());var l;return r[0]=a-o.left,r[1]=i-o.top,r}},{}],77:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(a,(function(t,r,a){var o=r.toLowerCase();for(a=function(t){var e=t.match(i);return e?e.map(Number):[]}(a),"m"==o&&a.length>2&&(e.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==n[o])return a.unshift(r),e.push(a);if(a.length<n[o])throw new Error("malformed path data");e.push([r].concat(a.splice(0,n[o])))}})),e};var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},a=/([astvzqmhlc])([^astvzqmhlc]*)/gi;var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi},{}],78:[function(t,e,r){(function(t){(function(){"use strict";function r(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function n(t,e){for(var r,n="",a=0,i=-1,o=0,l=0;l<=t.length;++l){if(l<t.length)r=t.charCodeAt(l);else{if(47===r)break;r=47}if(47===r){if(i===l-1||1===o);else if(i!==l-1&&2===o){if(n.length<2||2!==a||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var s=n.lastIndexOf("/");if(s!==n.length-1){-1===s?(n="",a=0):a=(n=n.slice(0,s)).length-1-n.lastIndexOf("/"),i=l,o=0;continue}}else if(2===n.length||1===n.length){n="",a=0,i=l,o=0;continue}e&&(n.length>0?n+="/..":n="..",a=2)}else n.length>0?n+="/"+t.slice(i+1,l):n=t.slice(i+1,l),a=l-i-1;i=l,o=0}else 46===r&&-1!==o?++o:o=-1}return n}var a={resolve:function(){for(var e,a="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var l;o>=0?l=arguments[o]:(void 0===e&&(e=t.cwd()),l=e),r(l),0!==l.length&&(a=l+"/"+a,i=47===l.charCodeAt(0))}return a=n(a,!i),i?a.length>0?"/"+a:"/":a.length>0?a:"."},normalize:function(t){if(r(t),0===t.length)return".";var e=47===t.charCodeAt(0),a=47===t.charCodeAt(t.length-1);return 0!==(t=n(t,!e)).length||e||(t="."),t.length>0&&a&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return r(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var n=arguments[e];r(n),n.length>0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":a.normalize(t)},relative:function(t,e){if(r(t),r(e),t===e)return"";if((t=a.resolve(t))===(e=a.resolve(e)))return"";for(var n=1;n<t.length&&47===t.charCodeAt(n);++n);for(var i=t.length,o=i-n,l=1;l<e.length&&47===e.charCodeAt(l);++l);for(var s=e.length-l,c=o<s?o:s,u=-1,f=0;f<=c;++f){if(f===c){if(s>c){if(47===e.charCodeAt(l+f))return e.slice(l+f+1);if(0===f)return e.slice(l+f)}else o>c&&(47===t.charCodeAt(n+f)?u=f:0===f&&(u=0));break}var d=t.charCodeAt(n+f);if(d!==e.charCodeAt(l+f))break;47===d&&(u=f)}var p="";for(f=n+u+1;f<=i;++f)f!==i&&47!==t.charCodeAt(f)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(l+u):(l+=u,47===e.charCodeAt(l)&&++l,e.slice(l))},_makeLong:function(t){return t},dirname:function(t){if(r(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,a=-1,i=!0,o=t.length-1;o>=1;--o)if(47===(e=t.charCodeAt(o))){if(!i){a=o;break}}else i=!1;return-1===a?n?"/":".":n&&1===a?"//":t.slice(0,a)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');r(t);var n,a=0,i=-1,o=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var l=e.length-1,s=-1;for(n=t.length-1;n>=0;--n){var c=t.charCodeAt(n);if(47===c){if(!o){a=n+1;break}}else-1===s&&(o=!1,s=n+1),l>=0&&(c===e.charCodeAt(l)?-1==--l&&(i=n):(l=-1,i=s))}return a===i?i=s:-1===i&&(i=t.length),t.slice(a,i)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!o){a=n+1;break}}else-1===i&&(o=!1,i=n+1);return-1===i?"":t.slice(a,i)},extname:function(t){r(t);for(var e=-1,n=0,a=-1,i=!0,o=0,l=t.length-1;l>=0;--l){var s=t.charCodeAt(l);if(47!==s)-1===a&&(i=!1,a=l+1),46===s?-1===e?e=l:1!==o&&(o=1):-1!==e&&(o=-1);else if(!i){n=l+1;break}}return-1===e||-1===a||0===o||1===o&&e===a-1&&e===n+1?"":t.slice(e,a)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+t+n:n}("/",t)},parse:function(t){r(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,a=t.charCodeAt(0),i=47===a;i?(e.root="/",n=1):n=0;for(var o=-1,l=0,s=-1,c=!0,u=t.length-1,f=0;u>=n;--u)if(47!==(a=t.charCodeAt(u)))-1===s&&(c=!1,s=u+1),46===a?-1===o?o=u:1!==f&&(f=1):-1!==o&&(f=-1);else if(!c){l=u+1;break}return-1===o||-1===s||0===f||1===f&&o===s-1&&o===l+1?-1!==s&&(e.base=e.name=0===l&&i?t.slice(1,s):t.slice(l,s)):(0===l&&i?(e.name=t.slice(1,o),e.base=t.slice(1,s)):(e.name=t.slice(l,o),e.base=t.slice(l,s)),e.ext=t.slice(o,s)),l>0?e.dir=t.slice(0,l-1):i&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,e.exports=a}).call(this)}).call(this,t("_process"))},{_process:87}],79:[function(t,e,r){
/*
* @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc
* @license MIT
* @preserve Project Home: https://github.com/voidqk/polybooljs
*/
var n,a=t("./lib/build-log"),i=t("./lib/epsilon"),o=t("./lib/intersecter"),l=t("./lib/segment-chainer"),s=t("./lib/segment-selector"),c=t("./lib/geojson"),u=!1,f=i();function d(t,e,r){var a=n.segments(t),i=n.segments(e),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(t){return!0===t?u=a():!1===t&&(u=!1),!1!==u&&u.list},epsilon:function(t){return f.epsilon(t)},segments:function(t){var e=o(!0,f,u);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:o(!1,f,u).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:s.union(t.combined,u),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:s.intersect(t.combined,u),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:s.difference(t.combined,u),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:s.differenceRev(t.combined,u),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:s.xor(t.combined,u),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:l(t.segments,f,u),inverted:t.inverted}},polygonFromGeoJSON:function(t){return c.toPolygon(n,t)},polygonToGeoJSON:function(t){return c.fromPolygon(n,f,t)},union:function(t,e){return d(t,e,n.selectUnion)},intersect:function(t,e){return d(t,e,n.selectIntersect)},difference:function(t,e){return d(t,e,n.selectDifference)},differenceRev:function(t,e){return d(t,e,n.selectDifferenceRev)},xor:function(t,e){return d(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":80,"./lib/epsilon":81,"./lib/geojson":82,"./lib/intersecter":83,"./lib/segment-chainer":85,"./lib/segment-selector":86}],80:[function(t,e,r){e.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return n("div_seg",{seg:t,pt:e}),n("chop",{seg:t,pt:e})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,e){return n("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,e,r){return n("temp_status",{seg:t,above:e,below:r})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,e,r){return n("status",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,e){return n("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return n("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return n("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,e){return n("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return n("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return n("chain_con",{index1:t,index2:e})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,e){return n("chain_join",{index1:t,index2:e})},done:function(){return n("done")}}}},{}],81:[function(t,e,r){e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var a=r[0],i=r[1],o=n[0],l=n[1],s=e[0];return(o-a)*(e[1]-i)-(l-i)*(s-a)>=-t},pointBetween:function(e,r,n){var a=e[1]-r[1],i=n[0]-r[0],o=e[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s<t)&&!(s-(i*i+l*l)>-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])<t},pointsSameY:function(e,r){return Math.abs(e[1]-r[1])<t},pointsSame:function(t,r){return e.pointsSameX(t,r)&&e.pointsSameY(t,r)},pointsCompare:function(t,r){return e.pointsSameX(t,r)?e.pointsSameY(t,r)?0:t[1]<r[1]?-1:1:t[0]<r[0]?-1:1},pointsCollinear:function(e,r,n){var a=e[0]-r[0],i=e[1]-r[1],o=r[0]-n[0],l=r[1]-n[1];return Math.abs(a*l-o*i)<t},linesIntersect:function(e,r,n,a){var i=r[0]-e[0],o=r[1]-e[1],l=a[0]-n[0],s=a[1]-n[1],c=i*s-o*l;if(Math.abs(c)<t)return!1;var u=e[0]-n[0],f=e[1]-n[1],d=(l*f-s*u)/c,p=(i*f-o*u)/c,h={alongA:0,alongB:0,pt:[e[0]+d*i,e[1]+d*o]};return h.alongA=d<=-t?-2:d<t?-1:d-1<=-t?0:d-1<t?1:2,h.alongB=p<=-t?-2:p<t?-1:p-1<=-t?0:p-1<t?1:2,h},pointInsideRegion:function(e,r){for(var n=e[0],a=e[1],i=r[r.length-1][0],o=r[r.length-1][1],l=!1,s=0;s<r.length;s++){var c=r[s][0],u=r[s][1];u-a>t!=o-a>t&&(i-c)*(a-u)/(o-u)+c-n>t&&(l=!l),i=c,o=u}return l}};return e}},{}],82:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),a=1;a<e.length;a++)n=t.selectDifference(t.combine(n,r(e[a])));return n}if("Polygon"===e.type)return t.polygon(r(e.coordinates));if("MultiPolygon"===e.type){for(var n=t.segments({inverted:!1,regions:[]}),a=0;a<e.coordinates.length;a++)n=t.selectUnion(t.combine(n,r(e.coordinates[a])));return t.polygon(n)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(t,e,r){function n(t,r){return e.pointInsideRegion([.5*(t[0][0]+t[1][0]),.5*(t[0][1]+t[1][1])],r)}function a(t){return{region:t,children:[]}}r=t.polygon(t.segments(r));var i=a(null);function o(t,e){for(var r=0;r<t.children.length;r++){if(n(e,(l=t.children[r]).region))return void o(l,e)}var i=a(e);for(r=0;r<t.children.length;r++){var l;n((l=t.children[r]).region,e)&&(i.children.push(l),t.children.splice(r,1),r--)}t.children.push(i)}for(var l=0;l<r.regions.length;l++){var s=r.regions[l];s.length<3||o(i,s)}function c(t,e){for(var r=0,n=t[t.length-1][0],a=t[t.length-1][1],i=[],o=0;o<t.length;o++){var l=t[o][0],s=t[o][1];i.push([l,s]),r+=s*n-l*a,n=l,a=s}return r<0!==e&&i.reverse(),i.push([i[0][0],i[0][1]]),i}var u=[];function f(t){var e=[c(t.region,!1)];u.push(e);for(var r=0;r<t.children.length;r++)e.push(d(t.children[r]))}function d(t){for(var e=0;e<t.children.length;e++)f(t.children[e]);return c(t.region,!0)}for(l=0;l<i.children.length;l++)f(i.children[l]);return u.length<=0?{type:"Polygon",coordinates:[]}:1==u.length?{type:"Polygon",coordinates:u[0]}:{type:"MultiPolygon",coordinates:u}}};e.exports=n},{}],83:[function(t,e,r){var n=t("./linked-list");e.exports=function(t,e,r){function a(t,e,n){return{id:r?r.segmentId():-1,start:t,end:e,myFill:{above:n.myFill.above,below:n.myFill.below},otherFill:null}}var i=n.create();function o(t,r){i.insertBefore(t,(function(n){return function(t,r,n,a,i,o){var l=e.pointsCompare(r,i);return 0!==l?l:e.pointsSame(n,o)?0:t!==a?t?1:-1:e.pointAboveOrOnLine(n,a?i:o,a?o:i)?1:-1}(t.isStart,t.pt,r,n.isStart,n.pt,n.other.pt)<0}))}function l(t,e){var r=function(t,e){var r=n.node({isStart:!0,pt:t.start,seg:t,primary:e,other:null,status:null});return o(r,t.end),r}(t,e);return function(t,e,r){var a=n.node({isStart:!1,pt:e.end,seg:e,primary:r,other:t,status:null});t.other=a,o(a,t.pt)}(r,t,e),r}function s(t,e){var n=a(e,t.seg.end,t.seg);return function(t,e){r&&r.segmentChop(t.seg,e),t.other.remove(),t.seg.end=e,t.other.pt=e,o(t.other,t.pt)}(t,e),l(n,t.primary)}function c(a,o){var l=n.create();function c(t){return l.findTransition((function(r){var n,a,i,o,l,s;return(n=t,a=r.ev,i=n.seg.start,o=n.seg.end,l=a.seg.start,s=a.seg.end,e.pointsCollinear(i,l,s)?e.pointsCollinear(o,l,s)||e.pointAboveOrOnLine(o,l,s)?1:-1:e.pointAboveOrOnLine(i,l,s)?1:-1)>0}))}function u(t,n){var a=t.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=e.linesIntersect(o,l,c,u);if(!1===f){if(!e.pointsCollinear(o,l,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(l,c))return!1;var d=e.pointsSame(o,c),p=e.pointsSame(l,u);if(d&&p)return n;var h=!d&&e.pointBetween(o,c,u),g=!p&&e.pointBetween(l,c,u);if(d)return g?s(n,l):s(t,u),n;h&&(p||(g?s(n,l):s(t,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(t,c):0===f.alongB?s(t,f.pt):1===f.alongB&&s(t,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var t=u(d,h);if(t)return t}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var m,y=v();if(y){var x;if(t)(x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=d.seg.myFill;r&&r.segmentUpdate(y.seg),d.other.remove(),d.remove()}if(i.getHead()!==d){r&&r.rewind(d.seg);continue}if(t)x=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=x?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)m=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:m,below:m};r&&r.status(d.seg,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,a,i,o=t[t.length-1],s=0;s<t.length;s++){n=o,o=t[s];var c=e.pointsCompare(n,o);0!==c&&l((a=c<0?n:o,i=c<0?o:n,{id:r?r.segmentId():-1,start:a,end:i,myFill:{above:null,below:null},otherFill:null}),!0)}},calculate:function(t){return c(t,!1)}}:{calculate:function(t,e,r,n){return t.forEach((function(t){l(a(t.start,t.end,t),!0)})),r.forEach((function(t){l(a(t.start,t.end,t),!1)})),c(e,n)}}}},{"./linked-list":84}],84:[function(t,e,r){e.exports={create:function(){var t={root:{root:!0,next:null},exists:function(e){return null!==e&&e!==t.root},isEmpty:function(){return null===t.root.next},getHead:function(){return t.root.next},insertBefore:function(e,r){for(var n=t.root,a=t.root.next;null!==a;){if(r(a))return e.prev=a.prev,e.next=a,a.prev.next=e,void(a.prev=e);n=a,a=a.next}n.next=e,e.prev=n,e.next=null},findTransition:function(e){for(var r=t.root,n=t.root.next;null!==n&&!e(n);)r=n,n=n.next;return{before:r===t.root?null:r,after:n,insert:function(t){return t.prev=r,t.next=n,r.next=t,null!==n&&(n.prev=t),t}}}};return t},node:function(t){return t.prev=null,t.next=null,t.remove=function(){t.prev.next=t.next,t.next&&(t.next.prev=t.prev),t.prev=null,t.next=null},t}}},{}],85:[function(t,e,r){e.exports=function(t,e,r){var n=[],a=[];return t.forEach((function(t){var i=t.start,o=t.end;if(e.pointsSame(i,o))console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");else{r&&r.chainStart(t);for(var l={index:0,matches_head:!1,matches_pt1:!1},s={index:0,matches_head:!1,matches_pt1:!1},c=l,u=0;u<n.length;u++){var f=(v=n[u])[0],d=(v[1],v[v.length-1]);v[v.length-2];if(e.pointsSame(f,i)){if(k(u,!0,!0))break}else if(e.pointsSame(f,o)){if(k(u,!0,!1))break}else if(e.pointsSame(d,i)){if(k(u,!1,!0))break}else if(e.pointsSame(d,o)&&k(u,!1,!1))break}if(c===l)return n.push([i,o]),void(r&&r.chainNew(i,o));if(c===s){r&&r.chainMatch(l.index);var p=l.index,h=l.matches_pt1?o:i,g=l.matches_head,v=n[p],m=g?v[0]:v[v.length-1],y=g?v[1]:v[v.length-2],x=g?v[v.length-1]:v[0],b=g?v[v.length-2]:v[1];return e.pointsCollinear(y,m,h)&&(g?(r&&r.chainRemoveHead(l.index,h),v.shift()):(r&&r.chainRemoveTail(l.index,h),v.pop()),m=y),e.pointsSame(x,h)?(n.splice(p,1),e.pointsCollinear(b,x,m)&&(g?(r&&r.chainRemoveTail(l.index,m),v.pop()):(r&&r.chainRemoveHead(l.index,m),v.shift())),r&&r.chainClose(l.index),void a.push(v)):void(g?(r&&r.chainAddHead(l.index,h),v.unshift(h)):(r&&r.chainAddTail(l.index,h),v.push(h)))}var _=l.index,w=s.index;r&&r.chainConnect(_,w);var T=n[_].length<n[w].length;l.matches_head?s.matches_head?T?(M(_),A(_,w)):(M(w),A(w,_)):A(w,_):s.matches_head?A(_,w):T?(M(_),A(w,_)):(M(w),A(_,w))}function k(t,e,r){return c.index=t,c.matches_head=e,c.matches_pt1=r,c===l?(c=s,!1):(c=null,!0)}function M(t){r&&r.chainReverse(t),n[t].reverse()}function A(t,a){var i=n[t],o=n[a],l=i[i.length-1],s=i[i.length-2],c=o[0],u=o[1];e.pointsCollinear(s,l,c)&&(r&&r.chainRemoveTail(t,l),i.pop(),l=s),e.pointsCollinear(l,c,u)&&(r&&r.chainRemoveHead(a,c),o.shift()),r&&r.chainJoin(t,a),n[t]=i.concat(o),n.splice(a,1)}})),a}},{}],86:[function(t,e,r){function n(t,e,r){var n=[];return t.forEach((function(t){var a=(t.myFill.above?8:0)+(t.myFill.below?4:0)+(t.otherFill&&t.otherFill.above?2:0)+(t.otherFill&&t.otherFill.below?1:0);0!==e[a]&&n.push({id:r?r.segmentId():-1,start:t.start,end:t.end,myFill:{above:1===e[a],below:2===e[a]},otherFill:null})})),r&&r.selected(n),n}var a={union:function(t,e){return n(t,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],e)},intersect:function(t,e){return n(t,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],e)},difference:function(t,e){return n(t,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],e)},differenceRev:function(t,e){return n(t,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],e)},xor:function(t,e){return n(t,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],e)}};e.exports=a},{}],87:[function(t,e,r){var n,a,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{a="function"==typeof clearTimeout?clearTimeout:l}catch(t){a=l}}();var c,u=[],f=!1,d=-1;function p(){f&&c&&(f=!1,c.length?u=c.concat(u):d=-1,u.length&&h())}function h(){if(!f){var t=s(p);f=!0;for(var e=u.length;e;){for(c=u,u=[];++d<e;)c&&c[d].run();d=-1,e=u.length}c=null,f=!1,function(t){if(a===clearTimeout)return clearTimeout(t);if((a===l||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(t);try{a(t)}catch(e){try{return a.call(null,t)}catch(e){return a.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function v(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new g(t,e)),1!==u.length||f||s(h)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],88:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,a=0,i=t.round,o=t.min,l=t.max,s=t.random;function c(e,s){if(s=s||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,s);var u=function(e){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,f=!1,d=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,a=!1;if(L[t])t=L[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=H.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=H.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=H.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=H.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=H.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=H.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=H.hex8.exec(t))return{r:z(e[1]),g:z(e[2]),b:z(e[3]),a:R(e[4]),format:a?"name":"hex8"};if(e=H.hex6.exec(t))return{r:z(e[1]),g:z(e[2]),b:z(e[3]),format:a?"name":"hex"};if(e=H.hex4.exec(t))return{r:z(e[1]+""+e[1]),g:z(e[2]+""+e[2]),b:z(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:a?"name":"hex8"};if(e=H.hex3.exec(t))return{r:z(e[1]+""+e[1]),g:z(e[2]+""+e[2]),b:z(e[3]+""+e[3]),format:a?"name":"hex"};return!1}(e));"object"==typeof e&&(j(e.r)&&j(e.g)&&j(e.b)?(p=e.r,h=e.g,g=e.b,a={r:255*O(p,255),g:255*O(h,255),b:255*O(g,255)},f=!0,d="%"===String(e.r).substr(-1)?"prgb":"rgb"):j(e.h)&&j(e.s)&&j(e.v)?(s=E(e.s),c=E(e.v),a=function(e,r,n){e=6*O(e,360),r=O(r,100),n=O(n,100);var a=t.floor(e),i=e-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(e.h,s,c),f=!0,d="hsv"):j(e.h)&&j(e.s)&&j(e.l)&&(s=E(e.s),u=E(e.l),a=function(t,e,r){var n,a,i;function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=O(t,360),e=O(e,100),r=O(r,100),0===e)n=a=i=r;else{var l=r<.5?r*(1+e):r+e-r*e,s=2*r-l;n=o(s,l,t+1/3),a=o(s,l,t),i=o(s,l,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,s,u),f=!0,d="hsl"),e.hasOwnProperty("a")&&(i=e.a));var p,h,g;return i=C(i),{ok:f,format:e.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(t,e,r){t=O(t,255),e=O(e,255),r=O(r,255);var n,a,i=l(t,e,r),s=o(t,e,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case t:n=(e-r)/u+(e<r?6:0);break;case e:n=(r-t)/u+2;break;case r:n=(t-e)/u+4}n/=6}return{h:n,s:a,l:c}}function f(t,e,r){t=O(t,255),e=O(e,255),r=O(r,255);var n,a,i=l(t,e,r),s=o(t,e,r),c=i,u=i-s;if(a=0===i?0:u/i,i==s)n=0;else{switch(i){case t:n=(e-r)/u+(e<r?6:0);break;case e:n=(r-t)/u+2;break;case r:n=(t-e)/u+4}n/=6}return{h:n,s:a,v:c}}function d(t,e,r,n){var a=[P(i(t).toString(16)),P(i(e).toString(16)),P(i(r).toString(16))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function p(t,e,r,n){return[P(I(n)),P(i(t).toString(16)),P(i(e).toString(16)),P(i(r).toString(16))].join("")}function h(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.s-=e/100,r.s=D(r.s),c(r)}function g(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.s+=e/100,r.s=D(r.s),c(r)}function v(t){return c(t).desaturate(100)}function m(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.l+=e/100,r.l=D(r.l),c(r)}function y(t,e){e=0===e?0:e||10;var r=c(t).toRgb();return r.r=l(0,o(255,r.r-i(-e/100*255))),r.g=l(0,o(255,r.g-i(-e/100*255))),r.b=l(0,o(255,r.b-i(-e/100*255))),c(r)}function x(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.l-=e/100,r.l=D(r.l),c(r)}function b(t,e){var r=c(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,c(r)}function _(t){var e=c(t).toHsl();return e.h=(e.h+180)%360,c(e)}function w(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+120)%360,s:e.s,l:e.l}),c({h:(r+240)%360,s:e.s,l:e.l})]}function T(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+90)%360,s:e.s,l:e.l}),c({h:(r+180)%360,s:e.s,l:e.l}),c({h:(r+270)%360,s:e.s,l:e.l})]}function k(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+72)%360,s:e.s,l:e.l}),c({h:(r+216)%360,s:e.s,l:e.l})]}function M(t,e,r){e=e||6,r=r||30;var n=c(t).toHsl(),a=360/r,i=[c(t)];for(n.h=(n.h-(a*e>>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/e;e--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=C(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return d(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,a){var o=[P(i(t).toString(16)),P(i(e).toString(16)),P(i(r).toString(16)),P(I(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+p(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=c(t);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:E(t[n]));t=r}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),a=c(e).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(e,r){var n=c(e),a=c(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,a,i=c.readability(t,e);switch(a=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(t,e,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;u<e.length;u++)(n=c.readability(t,e[u]))>s&&(s=n,l=c(e[u]));return c.isReadable(t,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(L);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function O(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,l(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function D(t){return o(1,l(0,t))}function z(t){return parseInt(t,16)}function P(t){return 1==t.length?"0"+t:""+t}function E(t){return t<=1&&(t=100*t+"%"),t}function I(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return z(t)/255}var F,N,B,H=(N="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",B="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+B),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function j(t){return!!H.CSS_UNIT.exec(t)}"undefined"!=typeof e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],89:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],90:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),i=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":208,"../../plot_api/plot_template":268,"../../plots/cartesian/constants":285,"../../plots/font_attributes":307,"./arrow_paths":89}],91:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=a.getFromId(t,e.xref),n=a.getFromId(t,e.yref),i=a.getRefType(e.xref),o=a.getRefType(e.yref);e._extremes={},"range"===i&&l(e,r),"range"===o&&l(e,n)}))}function l(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],l=t["a"+i],s=t[i+"ref"],c=t["a"+i+"ref"],u=t["_"+i+"padplus"],f=t["_"+i+"padminus"],d={x:1,y:-1}[i]*t[i+"shift"],p=3*t.arrowsize*t.arrowwidth||0,h=p+d,g=p-d,v=3*t.startarrowsize*t.arrowwidth||0,m=v+d,y=v-d;if(c===s){var x=a.findExtremes(e,[e.r2c(o)],{ppadplus:h,ppadminus:g}),b=a.findExtremes(e,[e.r2c(l)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else m=l?m+l:m,y=l?y-l:y,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,h,m),ppadminus:Math.max(f,g,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([i,o],t)}},{"../../lib":233,"../../plots/cartesian/axes":279,"./draw":96}],92:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,a,i,o,s,c,u=t._fullLayout.annotations,f=[],d=[],p=[],h=(e||[]).length;for(r=0;r<u.length;r++)if(i=(a=u[r]).clicktoshow){for(n=0;n<h;n++)if(s=(o=e[n]).xaxis,c=o.yaxis,s._id===a.xref&&c._id===a.yref&&s.d2r(o.x)===l(a._xclick,s)&&c.d2r(o.y)===l(a._yclick,c)){(a.visible?"onout"===i?d:p:f).push(r);break}n===h&&a.visible&&"onout"===i&&d.push(r)}return{on:f,off:d,explicitOff:p}}function l(t,e){return"log"===e.type?e.l2r(t):e.d2r(t)}e.exports={hasClickToShow:function(t,e){var r=o(t,e);return r.on.length>0||r.explicitOff.length>0},onClick:function(t,e){var r,l,s=o(t,e),c=s.on,u=s.off.concat(s.explicitOff),f={},d=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r<c.length;r++)(l=i(t.layout,"annotations",d[c[r]])).modifyItem("visible",!0),n.extendFlat(f,l.getUpdateObj());for(r=0;r<u.length;r++)(l=i(t.layout,"annotations",d[u[r]])).modifyItem("visible",!1),n.extendFlat(f,l.getUpdateObj());return a.call("update",t,{},f)}}},{"../../lib":233,"../../plot_api/plot_template":268,"../../registry":326}],93:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color");e.exports=function(t,e,r,i){i("opacity");var o=i("bgcolor"),l=i("bordercolor"),s=a.opacity(l);i("borderpad");var c=i("borderwidth"),u=i("showarrow");if(i("text",u?" ":r._dfltTitle.annotation),i("textangle"),n.coerceFont(i,"font",r.font),i("width"),i("align"),i("height")&&i("valign"),u){var f,d,p=i("arrowside");-1!==p.indexOf("end")&&(f=i("arrowhead"),d=i("arrowsize")),-1!==p.indexOf("start")&&(i("startarrowhead",f),i("startarrowsize",d)),i("arrowcolor",s?e.bordercolor:a.defaultLine),i("arrowwidth",2*(s&&c||1)),i("standoff"),i("startstandoff")}var h=i("hovertext"),g=r.hoverlabel||{};if(h){var v=i("hoverlabel.bgcolor",g.bgcolor||(a.opacity(o)?a.rgb(o):a.defaultLine)),m=i("hoverlabel.bordercolor",g.bordercolor||a.contrast(v));n.coerceFont(i,"hoverlabel.font",{family:g.font.family,size:g.font.size,color:g.font.color||m})}i("captureevents",!!h)}},{"../../lib":233,"../color":105}],94:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,i){e=e||{};var o="log"===r&&"linear"===e.type,l="linear"===r&&"log"===e.type;if(o||l)for(var s,c,u=t._fullLayout.annotations,f=e._id.charAt(0),d=0;d<u.length;d++)s=u[d],c="annotations["+d+"].",s[f+"ref"]===e._id&&p(f),s["a"+f+"ref"]===e._id&&p("a"+f);function p(t){var r=s[t],l=null;l=o?a(r,e.range):Math.pow(10,r),n(l)||(l=null),i(c+t,l)}}},{"../../lib/to_log_range":257,"fast-isnumeric":23}],95:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("./common_defaults"),l=t("./attributes");function s(t,e,r){function i(r,a){return n.coerce(t,e,l,r,a)}var s=i("visible"),c=i("clicktoshow");if(s||c){o(t,e,r,i);for(var u=e.showarrow,f=["x","y"],d=[-10,-30],p={_fullLayout:r},h=0;h<2;h++){var g=f[h],v=a.coerceRef(t,e,p,g,"","paper");if("paper"!==v)a.getFromId(p,v)._annIndices.push(e._index);if(a.coercePosition(e,p,i,v,g,.5),u){var m="a"+g,y=a.coerceRef(t,e,p,m,"pixel",["pixel","paper"]);"pixel"!==y&&y!==v&&(y=e[m]="pixel");var x="pixel"===y?d[h]:.4;a.coercePosition(e,p,i,y,m,x)}i(g+"anchor"),i(g+"shift")}if(n.noneOrAll(t,e,["x","y"]),u&&n.noneOrAll(t,e,["ax","ay"]),c){var b=i("xclick"),_=i("yclick");e._xclick=void 0===b?e.x:a.cleanPosition(b,p,e.xref),e._yclick=void 0===_?e.y:a.cleanPosition(_,p,e.yref)}}}e.exports=function(t,e){i(t,e,{name:"annotations",handleItemDefaults:s})}},{"../../lib":233,"../../plots/array_container_defaults":274,"../../plots/cartesian/axes":279,"./attributes":90,"./common_defaults":93}],96:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../../lib"),l=o.strTranslate,s=t("../../plots/cartesian/axes"),c=t("../color"),u=t("../drawing"),f=t("../fx"),d=t("../../lib/svg_text_utils"),p=t("../../lib/setcursor"),h=t("../dragelement"),g=t("../../plot_api/plot_template").arrayEditor,v=t("./draw_arrow_head");function m(t,e){var r=t._fullLayout.annotations[e]||{},n=s.getFromId(t,r.xref),a=s.getFromId(t,r.yref);n&&n.setScale(),a&&a.setScale(),x(t,r,e,!1,n,a)}function y(t,e,r,n,a){var i=a[r],o=a[r+"ref"],l=-1!==r.indexOf("y"),c="domain"===s.getRefType(o),u=l?n.h:n.w;return t?c?i+(l?-e:e)/t._length:t.p2r(t.r2p(i)+e):i+(l?-e:e)/u}function x(t,e,r,i,m,x){var b,_,w=t._fullLayout,T=t._fullLayout._size,k=t._context.edits;i?(b="annotation-"+i,_=i+".annotations"):(b="annotation",_="annotations");var M=g(t.layout,_,e),A=M.modifyBase,L=M.modifyItem,S=M.getUpdateObj;w._infolayer.selectAll("."+b+'[data-index="'+r+'"]').remove();var C="clip"+w._uid+"_ann"+r;if(e._input&&!1!==e.visible){var O={x:{},y:{}},D=+e.textangle||0,z=w._infolayer.append("g").classed(b,!0).attr("data-index",String(r)).style("opacity",e.opacity),P=z.append("g").classed("annotation-text-g",!0),E=k[e.showarrow?"annotationTail":"annotationPosition"],I=e.captureevents||k.annotationText||E,R=P.append("g").style("pointer-events",I?"all":null).call(p,"pointer").on("click",(function(){t._dragging=!1,t.emit("plotly_clickannotation",Z(n.event))}));e.hovertext&&R.on("mouseover",(function(){var r=e.hoverlabel,n=r.font,a=this.getBoundingClientRect(),i=t.getBoundingClientRect();f.loneHover({x0:a.left-i.left,x1:a.right-i.left,y:(a.top+a.bottom)/2-i.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:w._hoverlayer.node(),outerContainer:w._paper.node(),gd:t})})).on("mouseout",(function(){f.loneUnhover(w._hoverlayer.node())}));var F=e.borderwidth,N=e.borderpad,B=F+N,H=R.append("rect").attr("class","bg").style("stroke-width",F+"px").call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor),j=e.width||e.height,U=w._topclips.selectAll("#"+C).data(j?[0]:[]);U.enter().append("clipPath").classed("annclip",!0).attr("id",C).append("rect"),U.exit().remove();var V=e.font,q=w._meta?o.templateString(e.text,w._meta):e.text,G=R.append("text").classed("annotation-text",!0).text(q);k.annotationText?G.call(d.makeEditable,{delegate:R,gd:t}).call(Y).on("edit",(function(r){e.text=r,this.call(Y),L("text",r),m&&m.autorange&&A(m._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0),a.call("_guiRelayout",t,S())})):G.call(Y)}else n.selectAll("#"+C).remove();function Z(t){var n={index:r,annotation:e._input,fullAnnotation:e,event:t};return i&&(n.subplotId=i),n}function Y(r){return r.call(u.font,V).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),d.convertToTspans(r,t,X),r}function X(){var r=G.selectAll("a");1===r.size()&&r.text()===G.text()&&R.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(H.node());var n=R.select(".annotation-text-math-group"),f=!n.empty(),g=u.bBox((f?n:G).node()),b=g.width,_=g.height,M=e.width||b,I=e.height||_,N=Math.round(M+2*B),V=Math.round(I+2*B);function q(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var Y=!1,X=["x","y"],W=0;W<X.length;W++){var Q,J,$,K,tt,et=X[W],rt=e[et+"ref"]||et,nt=e["a"+et+"ref"],at={x:m,y:x}[et],it=(D+("x"===et?0:-90))*Math.PI/180,ot=N*Math.cos(it),lt=V*Math.sin(it),st=Math.abs(ot)+Math.abs(lt),ct=e[et+"anchor"],ut=e[et+"shift"]*("x"===et?1:-1),ft=O[et],dt=s.getRefType(rt);if(at&&"domain"!==dt){var pt=at.r2fraction(e[et]);(pt<0||pt>1)&&(nt===rt?((pt=at.r2fraction(e["a"+et]))<0||pt>1)&&(Y=!0):Y=!0),Q=at._offset+at.r2p(e[et]),K=.5}else{var ht="domain"===dt;"x"===et?($=e[et],Q=ht?at._offset+at._length*$:Q=T.l+T.w*$):($=1-e[et],Q=ht?at._offset+at._length*$:Q=T.t+T.h*$),K=e.showarrow?.5:$}if(e.showarrow){ft.head=Q;var gt=e["a"+et];if(tt=ot*q(.5,e.xanchor)-lt*q(.5,e.yanchor),nt===rt){var vt=s.getRefType(nt);"domain"===vt?("y"===et&&(gt=1-gt),ft.tail=at._offset+at._length*gt):"paper"===vt?"y"===et?(gt=1-gt,ft.tail=T.t+T.h*gt):ft.tail=T.l+T.w*gt:ft.tail=at._offset+at.r2p(gt),J=tt}else ft.tail=Q+gt,J=tt+gt;ft.text=ft.tail+tt;var mt=w["x"===et?"width":"height"];if("paper"===rt&&(ft.head=o.constrain(ft.head,1,mt-1)),"pixel"===nt){var yt=-Math.max(ft.tail-3,ft.text),xt=Math.min(ft.tail+3,ft.text)-mt;yt>0?(ft.tail+=yt,ft.text+=yt):xt>0&&(ft.tail-=xt,ft.text-=xt)}ft.tail+=ut,ft.head+=ut}else J=tt=st*q(K,ct),ft.text=Q+tt;ft.text+=ut,tt+=ut,J+=ut,e["_"+et+"padplus"]=st/2+J,e["_"+et+"padminus"]=st/2-J,e["_"+et+"size"]=st,e["_"+et+"shift"]=tt}if(Y)R.remove();else{var bt=0,_t=0;if("left"!==e.align&&(bt=(M-b)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(I-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:B+bt-1,y:B+_t}).call(u.setClipUrl,j?C:null,t);else{var wt=B+_t-g.top,Tt=B+bt-g.left;G.call(d.positionText,Tt,wt).call(u.setClipUrl,j?C:null,t)}U.select("rect").call(u.setRect,B,B,M,I),H.call(u.setRect,F/2,F/2,N-F,V-F),R.call(u.setTranslate,Math.round(O.x.text-N/2),Math.round(O.y.text-V/2)),P.attr({transform:"rotate("+D+","+O.x.text+","+O.y.text+")"});var kt,Mt=function(r,n){z.selectAll(".annotation-arrow-g").remove();var s=O.x.head,f=O.y.head,d=O.x.tail+r,p=O.y.tail+n,g=O.x.text+r,b=O.y.text+n,_=o.rotationXYMatrix(D,g,b),w=o.apply2DTransform(_),M=o.apply2DTransform2(_),C=+H.attr("width"),E=+H.attr("height"),I=g-.5*C,F=I+C,N=b-.5*E,B=N+E,j=[[I,N,I,B],[I,B,F,B],[F,B,F,N],[F,N,I,N]].map(M);if(!j.reduce((function(t,e){return t^!!o.segmentsIntersect(s,f,s+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){j.forEach((function(t){var e=o.segmentsIntersect(d,p,s,f,t[0],t[1],t[2],t[3]);e&&(d=e.x,p=e.y)}));var U=e.arrowwidth,V=e.arrowcolor,q=e.arrowside,G=z.append("g").style({opacity:c.opacity(V)}).classed("annotation-arrow-g",!0),Z=G.append("path").attr("d","M"+d+","+p+"L"+s+","+f).style("stroke-width",U+"px").call(c.stroke,c.rgb(V));if(v(Z,q,e),k.annotationPosition&&Z.node().parentNode&&!i){var Y=s,X=f;if(e.standoff){var W=Math.sqrt(Math.pow(s-d,2)+Math.pow(f-p,2));Y+=e.standoff*(d-s)/W,X+=e.standoff*(p-f)/W}var Q,J,$=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-Y)+","+(p-X),transform:l(Y,X)}).style("stroke-width",U+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");h.init({element:$.node(),gd:t,prepFn:function(){var t=u.getTranslate(R);Q=t.x,J=t.y,m&&m.autorange&&A(m._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(t,r){var n=w(Q,J),a=n[0]+t,i=n[1]+r;R.call(u.setTranslate,a,i),L("x",y(m,t,"x",T,e)),L("y",y(x,r,"y",T,e)),e.axref===e.xref&&L("ax",y(m,t,"ax",T,e)),e.ayref===e.yref&&L("ay",y(x,r,"ay",T,e)),G.attr("transform",l(t,r)),P.attr({transform:"rotate("+D+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,S());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&Mt(0,0),E)h.init({element:R.node(),gd:t,prepFn:function(){kt=P.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?L("ax",y(m,t,"ax",T,e)):L("ax",e.ax+t),e.ayref===e.yref?L("ay",y(x,r,"ay",T.w,e)):L("ay",e.ay+r),Mt(t,r);else{if(i)return;var a,o;if(m)a=y(m,t,"x",T,e);else{var s=e._xsize/T.w,c=e.x+(e._xshift-e.xshift)/T.w-s/2;a=h.align(c+t/T.w,s,0,1,e.xanchor)}if(x)o=y(x,r,"y",T,e);else{var u=e._ysize/T.h,f=e.y-(e._yshift+e.yshift)/T.h-u/2;o=h.align(f-r/T.h,u,0,1,e.yanchor)}L("x",a),L("y",o),m&&x||(n=h.getCursor(m?.5:a,x?.5:o,e.xanchor,e.yanchor))}P.attr({transform:l(t,r)+kt}),p(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",Z(n))},doneFn:function(){p(R),a.call("_guiRelayout",t,S());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&m(t,r);return i.previousPromises(t)},drawOne:m,drawRaw:x}},{"../../lib":233,"../../lib/setcursor":253,"../../lib/svg_text_utils":255,"../../plot_api/plot_template":268,"../../plots/cartesian/axes":279,"../../plots/plots":313,"../../registry":326,"../color":105,"../dragelement":124,"../drawing":127,"../fx":145,"./draw_arrow_head":97,d3:21}],97:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color"),i=t("./arrow_paths"),o=t("../../lib"),l=o.strScale,s=o.strRotate,c=o.strTranslate;e.exports=function(t,e,r){var o,u,f,d,p=t.node(),h=i[r.arrowhead||0],g=i[r.startarrowhead||0],v=(r.arrowwidth||1)*(r.arrowsize||1),m=(r.arrowwidth||1)*(r.startarrowsize||1),y=e.indexOf("start")>=0,x=e.indexOf("end")>=0,b=h.backoff*v+r.standoff,_=g.backoff*m+r.startstandoff;if("line"===p.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},u={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-u.x,T=o.y-u.y;if(d=(f=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void E();if(b){if(b*b>w*w+T*T)return void E();var k=b*Math.cos(f),M=b*Math.sin(f);u.x+=k,u.y+=M,t.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void E();var A=_*Math.cos(f),L=_*Math.sin(f);o.x-=A,o.y-=L,t.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var S=p.getTotalLength(),C="";if(S<b+_)return void E();var O=p.getPointAtLength(0),D=p.getPointAtLength(.1);f=Math.atan2(O.y-D.y,O.x-D.x),o=p.getPointAtLength(Math.min(_,S)),C="0px,"+_+"px,";var z=p.getPointAtLength(S),P=p.getPointAtLength(S-.1);d=Math.atan2(z.y-P.y,z.x-P.x),u=p.getPointAtLength(Math.max(0,S-b)),C+=S-(C?_+b:b)+"px,"+S+"px",t.style("stroke-dasharray",C)}function E(){t.style("stroke-dasharray","0px,100px")}function I(e,i,o,u){e.path&&(e.noRotate&&(o=0),n.select(p.parentNode).append("path").attr({class:t.attr("class"),d:e.path,transform:c(i.x,i.y)+s(180*o/Math.PI)+l(u)}).style({fill:a.rgb(r.arrowcolor),"stroke-width":0}))}y&&I(g,o,f,m),x&&I(h,u,d,v)}},{"../../lib":233,"../color":105,"./arrow_paths":89,d3:21}],98:[function(t,e,r){"use strict";var n=t("./draw"),a=t("./click");e.exports={moduleType:"component",name:"annotations",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("annotations"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,drawRaw:n.drawRaw,hasClickToShow:a.hasClickToShow,onClick:a.onClick,convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":291,"./attributes":90,"./calc_autorange":91,"./click":92,"./convert_coords":94,"./defaults":95,"./draw":96}],99:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),a=t("../../plot_api/edit_types").overrideAll,i=t("../../plot_api/plot_template").templatedArray;e.exports=a(i("annotation",{visible:n.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:n.xanchor,xshift:n.xshift,yanchor:n.yanchor,yshift:n.yshift,text:n.text,textangle:n.textangle,font:n.font,width:n.width,height:n.height,opacity:n.opacity,align:n.align,valign:n.valign,bgcolor:n.bgcolor,bordercolor:n.bordercolor,borderpad:n.borderpad,borderwidth:n.borderwidth,showarrow:n.showarrow,arrowcolor:n.arrowcolor,arrowhead:n.arrowhead,startarrowhead:n.startarrowhead,arrowside:n.arrowside,arrowsize:n.arrowsize,startarrowsize:n.startarrowsize,arrowwidth:n.arrowwidth,standoff:n.standoff,startstandoff:n.startstandoff,hovertext:n.hovertext,hoverlabel:n.hoverlabel,captureevents:n.captureevents}),"calc","from-root")},{"../../plot_api/edit_types":261,"../../plot_api/plot_template":268,"../annotations/attributes":90}],100:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes");function i(t,e){var r=e.fullSceneLayout.domain,i=e.fullLayout._size,o={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};t._xa={},n.extendFlat(t._xa,o),a.setConvert(t._xa),t._xa._offset=i.l+r.x[0]*i.w,t._xa.l2p=function(){return.5*(1+t._pdata[0]/t._pdata[3])*i.w*(r.x[1]-r.x[0])},t._ya={},n.extendFlat(t._ya,o),a.setConvert(t._ya),t._ya._offset=i.t+(1-r.y[1])*i.h,t._ya.l2p=function(){return.5*(1-t._pdata[1]/t._pdata[3])*i.h*(r.y[1]-r.y[0])}}e.exports=function(t){for(var e=t.fullSceneLayout.annotations,r=0;r<e.length;r++)i(e[r],t);t.fullLayout._infolayer.selectAll(".annotation-"+t.id).remove()}},{"../../lib":233,"../../plots/cartesian/axes":279}],101:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("../annotations/common_defaults"),l=t("./attributes");function s(t,e,r,i){function s(r,a){return n.coerce(t,e,l,r,a)}function c(t){var n=t+"axis",i={_fullLayout:{}};return i._fullLayout[n]=r[n],a.coercePosition(e,i,s,t,t,.5)}s("visible")&&(o(t,e,i.fullLayout,s),c("x"),c("y"),c("z"),n.noneOrAll(t,e,["x","y","z"]),e.xref="x",e.yref="y",e.zref="z",s("xanchor"),s("yanchor"),s("xshift"),s("yshift"),e.showarrow&&(e.axref="pixel",e.ayref="pixel",s("ax",-10),s("ay",-30),n.noneOrAll(t,e,["ax","ay"])))}e.exports=function(t,e,r){i(t,e,{name:"annotations",handleItemDefaults:s,fullLayout:r.fullLayout})}},{"../../lib":233,"../../plots/array_container_defaults":274,"../../plots/cartesian/axes":279,"../annotations/common_defaults":93,"./attributes":99}],102:[function(t,e,r){"use strict";var n=t("../annotations/draw").drawRaw,a=t("../../plots/gl3d/project"),i=["x","y","z"];e.exports=function(t){for(var e=t.fullSceneLayout,r=t.dataScale,o=e.annotations,l=0;l<o.length;l++){for(var s=o[l],c=!1,u=0;u<3;u++){var f=i[u],d=s[f],p=e[f+"axis"].r2fraction(d);if(p<0||p>1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+l+'"]').remove():(s._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(s.x)*r[0],e.yaxis.r2l(s.y)*r[1],e.zaxis.r2l(s.z)*r[2]]),n(t.graphDiv,s,l,t.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":310,"../annotations/draw":96}],103:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(t),l=0;l<o.length;l++){var s=o[l];i.test(s)&&(t[s].annotations||[]).length&&(a.pushUnique(e._basePlotModules,r),a.pushUnique(e._subplots.gl3d,s))}},convert:t("./convert"),draw:t("./draw")}},{"../../lib":233,"../../registry":326,"./attributes":99,"./convert":100,"./defaults":101,"./draw":102}],104:[function(t,e,r){"use strict";r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff",r.borderLine="#BEC8D9",r.lightFraction=1e3/11},{}],105:[function(t,e,r){"use strict";var n=t("tinycolor2"),a=t("fast-isnumeric"),i=e.exports={},o=t("./attributes");i.defaults=o.defaults;var l=i.defaultLine=o.defaultLine;i.lightLine=o.lightLine;var s=i.background=o.background;function c(t){if(a(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),i="a"===e.charAt(3)&&4===n.length;if(!i&&3!==n.length)return t;for(var o=0;o<n.length;o++){if(!n[o].length)return t;if(n[o]=Number(n[o]),!(n[o]>=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}i.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},i.rgb=function(t){return i.tinyRGB(n(t))},i.opacity=function(t){return t?n(t).getAlpha():0},i.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},i.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||s).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},i.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(i.combine(t,s))),(a.isDark()?e?a.lighten(e):s:r?a.darken(r):l).toString()},i.stroke=function(t,e){var r=n(e);t.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(t,e){var r=n(e);t.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,o=Object.keys(t);for(e=0;e<o.length;e++)if(a=t[n=o[e]],"color"===n.substr(n.length-5))if(Array.isArray(a))for(r=0;r<a.length;r++)a[r]=c(a[r]);else t[n]=c(a);else if("colorscale"===n.substr(n.length-10)&&Array.isArray(a))for(r=0;r<a.length;r++)Array.isArray(a[r])&&(a[r][1]=c(a[r][1]));else if(Array.isArray(a)){var l=a[0];if(!Array.isArray(l)&&l&&"object"==typeof l)for(r=0;r<a.length;r++)i.clean(a[r])}else a&&"object"==typeof a&&i.clean(a)}}},{"./attributes":104,"fast-isnumeric":23,tinycolor2:88}],106:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/layout_attributes"),a=t("../../plots/font_attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll;e.exports=o({thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",dflt:1.02,min:-2,max:3},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number",dflt:.5,min:-2,max:3},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},ypad:{valType:"number",min:0,dflt:10},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:i({},n.ticks,{dflt:""}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside bottom","inside bottom"],dflt:"outside"},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,minexponent:n.minexponent,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":227,"../../plot_api/edit_types":261,"../../plots/cartesian/layout_attributes":293,"../../plots/font_attributes":307}],107:[function(t,e,r){"use strict";e.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}},{}],108:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plot_api/plot_template"),i=t("../../plots/cartesian/tick_value_defaults"),o=t("../../plots/cartesian/tick_mark_defaults"),l=t("../../plots/cartesian/tick_label_defaults"),s=t("./attributes");e.exports=function(t,e,r){var c=a.newContainer(e,"colorbar"),u=t.colorbar||{};function f(t,e){return n.coerce(u,c,s,t,e)}var d=f("thicknessmode");f("thickness","fraction"===d?30/(r.width-r.margin.l-r.margin.r):30);var p=f("lenmode");f("len","fraction"===p?1:r.height-r.margin.t-r.margin.b),f("x"),f("xanchor"),f("xpad"),f("y"),f("yanchor"),f("ypad"),n.noneOrAll(u,c,["x","y"]),f("outlinecolor"),f("outlinewidth"),f("bordercolor"),f("borderwidth"),f("bgcolor");var h=f("ticklabelposition");i(u,c,f,"linear");var g={outerTicks:!1,font:r.font};-1!==h.indexOf("inside")&&(g.bgColor="black"),l(u,c,f,"linear",g),o(u,c,f,"linear",g),f("title.text",r._dfltTitle.colorbar),n.coerceFont(f,"title.font",r.font),f("title.side")}},{"../../lib":233,"../../plot_api/plot_template":268,"../../plots/cartesian/tick_label_defaults":300,"../../plots/cartesian/tick_mark_defaults":301,"../../plots/cartesian/tick_value_defaults":302,"./attributes":106}],109:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../plots/cartesian/axes"),s=t("../dragelement"),c=t("../../lib"),u=c.strTranslate,f=t("../../lib/extend").extendFlat,d=t("../../lib/setcursor"),p=t("../drawing"),h=t("../color"),g=t("../titles"),v=t("../../lib/svg_text_utils"),m=t("../colorscale/helpers").flipScale,y=t("../../plots/cartesian/axis_defaults"),x=t("../../plots/cartesian/position_defaults"),b=t("../../plots/cartesian/layout_attributes"),_=t("../../constants/alignment"),w=_.LINE_SPACING,T=_.FROM_TL,k=_.FROM_BR,M=t("./constants").cn;e.exports={draw:function(t){var e=t._fullLayout._infolayer.selectAll("g."+M.colorbar).data(function(t){var e,r,n,a,i=t._fullLayout,o=t.calcdata,l=[];function s(t){return f(t,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function c(){"function"==typeof a.calc?a.calc(t,n,e):(e._fillgradient=r.reversescale?m(r.colorscale):r.colorscale,e._zrange=[r[a.min],r[a.max]])}for(var u=0;u<o.length;u++){var d=o[u],p=(n=d[0].trace)._module.colorbar;if(!0===n.visible&&p)for(var h=Array.isArray(p),g=h?p:[p],v=0;v<g.length;v++){var y=(a=g[v]).container;(r=y?n[y]:n)&&r.showscale&&((e=s(r.colorbar))._id="cb"+n.uid+(h&&y?"-"+y:""),e._traceIndex=n.index,e._propPrefix=(y?y+".":"")+"colorbar.",e._meta=n._meta,c(),l.push(e))}}for(var x in i._colorAxes)if((r=i[x]).showscale){var b=i._colorAxes[x];(e=s(r.colorbar))._id="cb"+x,e._propPrefix=x+".colorbar.",e._meta=i._meta,a={min:"cmin",max:"cmax"},"heatmap"!==b[0]&&(n=b[1],a.calc=n._module.colorbar.calc),c(),l.push(e)}return l}(t),(function(t){return t._id}));e.enter().append("g").attr("class",(function(t){return t._id})).classed(M.colorbar,!0),e.each((function(e){var r=n.select(this);c.ensureSingle(r,"rect",M.cbbg),c.ensureSingle(r,"g",M.cbfills),c.ensureSingle(r,"g",M.cblines),c.ensureSingle(r,"g",M.cbaxis,(function(t){t.classed(M.crisp,!0)})),c.ensureSingle(r,"g",M.cbtitleunshift,(function(t){t.append("g").classed(M.cbtitle,!0)})),c.ensureSingle(r,"rect",M.cboutline);var m=function(t,e,r){var o=r._fullLayout,s=o._size,d=e._fillcolor,m=e._line,_=e.title,A=_.side,L=e._zrange||n.extent(("function"==typeof d?d:m.color).domain()),S="function"==typeof m.color?m.color:function(){return m.color},C="function"==typeof d?d:function(){return d},O=e._levels,D=function(t,e,r){var n,a,i=e._levels,o=[],l=[],s=i.end+i.size/100,c=i.size,u=1.001*r[0]-.001*r[1],f=1.001*r[1]-.001*r[0];for(a=0;a<1e5&&(n=i.start+a*c,!(c>0?n>=s:n<=s));a++)n>u&&n<f&&o.push(n);if(e._fillgradient)l=[0];else if("function"==typeof e._fillcolor){var d=e._filllevels;if(d)for(s=d.end+d.size/100,c=d.size,a=0;a<1e5&&(n=d.start+a*c,!(c>0?n>=s:n<=s));a++)n>r[0]&&n<r[1]&&l.push(n);else(l=o.map((function(t){return t-i.size/2}))).push(l[l.length-1]+i.size)}else e._fillcolor&&"string"==typeof e._fillcolor&&(l=[0]);i.size<0&&(o.reverse(),l.reverse());return{line:o,fill:l}}(0,e,L),z=D.fill,P=D.line,E=Math.round(e.thickness*("fraction"===e.thicknessmode?s.w:1)),I=E/s.w,R=Math.round(e.len*("fraction"===e.lenmode?s.h:1)),F=R/s.h,N=e.xpad/s.w,B=(e.borderwidth+e.outlinewidth)/2,H=e.ypad/s.h,j=Math.round(e.x*s.w+e.xpad),U=e.x-I*({middle:.5,right:1}[e.xanchor]||0),V=e.y+F*(({top:-.5,bottom:.5}[e.yanchor]||0)-.5),q=Math.round(s.h*(1-V)),G=q-R;e._lenFrac=F,e._thickFrac=I,e._xLeftFrac=U,e._yBottomFrac=V;var Z=e._axis=function(t,e,r){var n=t._fullLayout,a={type:"linear",range:r,tickmode:e.tickmode,nticks:e.nticks,tick0:e.tick0,dtick:e.dtick,tickvals:e.tickvals,ticktext:e.ticktext,ticks:e.ticks,ticklen:e.ticklen,tickwidth:e.tickwidth,tickcolor:e.tickcolor,showticklabels:e.showticklabels,ticklabelposition:e.ticklabelposition,tickfont:e.tickfont,tickangle:e.tickangle,tickformat:e.tickformat,exponentformat:e.exponentformat,minexponent:e.minexponent,separatethousands:e.separatethousands,showexponent:e.showexponent,showtickprefix:e.showtickprefix,tickprefix:e.tickprefix,showticksuffix:e.showticksuffix,ticksuffix:e.ticksuffix,title:e.title,showline:!0,anchor:"free",side:"right",position:1},i={type:"linear",_id:"y"+e._id},o={letter:"y",font:n.font,noHover:!0,noTickson:!0,noTicklabelmode:!0,calendar:n.calendar};function l(t,e){return c.coerce(a,i,b,t,e)}return y(a,i,l,o,n),x(a,i,l,o),i}(r,e,L);Z.position=e.x+N+I,-1!==["top","bottom"].indexOf(A)&&(Z.title.side=A,Z.titlex=e.x+N,Z.titley=V+("top"===_.side?F-H:H));if(m.color&&"auto"===e.tickmode){Z.tickmode="linear",Z.tick0=O.start;var Y=O.size,X=c.constrain((q-G)/50,4,15)+1,W=(L[1]-L[0])/((e.nticks||X)*Y);if(W>1){var Q=Math.pow(10,Math.floor(Math.log(W)/Math.LN10));Y*=Q*c.roundUp(W/Q,[2,5,10]),(Math.abs(O.start)/O.size+1e-6)%1<2e-6&&(Z.tick0=0)}Z.dtick=Y}Z.domain=[V+H,V+F-H],Z.setScale(),t.attr("transform",u(Math.round(s.l),Math.round(s.t)));var J,$=t.select("."+M.cbtitleunshift).attr("transform",u(-Math.round(s.l),-Math.round(s.t))),K=t.select("."+M.cbaxis),tt=0;function et(n,a){var i={propContainer:Z,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+M.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+l+",."+l+"-math-group").remove(),g.draw(r,n,f(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var t,r=s.l+(e.x+N)*s.w,n=Z.title.font.size;t="top"===A?(1-(V+F-H))*s.h+s.t+3+.75*n:(1-(V+H))*s.h+s.t-3-.25*n,et(Z._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var i=t.select("."+M.cbtitle),o=i.select("text"),f=[-e.outlinewidth/2,e.outlinewidth/2],d=i.select(".h"+Z._id+"title-math-group").node(),h=15.6;if(o.node()&&(h=parseInt(o.node().style.fontSize,10)*w),d?(tt=p.bBox(d).height)>h&&(f[1]-=(tt-h)/2):o.node()&&!o.classed(M.jsPlaceholder)&&(tt=p.bBox(o.node()).height),tt){if(tt+=5,"top"===A)Z.domain[1]-=tt/s.h,f[1]*=-1;else{Z.domain[0]+=tt/s.h;var g=v.lineCount(o);f[1]+=(1-g)*h}i.attr("transform",u(f[0],f[1])),Z.setScale()}}t.selectAll("."+M.cbfills+",."+M.cblines).attr("transform",u(0,Math.round(s.h*(1-Z.domain[1])))),K.attr("transform",u(0,Math.round(-s.t)));var y=t.select("."+M.cbfills).selectAll("rect."+M.cbfill).attr("style","").data(z);y.enter().append("rect").classed(M.cbfill,!0).style("stroke","none"),y.exit().remove();var x=L.map(Z.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,i){var o=[0===i?L[0]:(z[i]+z[i-1])/2,i===z.length-1?L[1]:(z[i]+z[i+1])/2].map(Z.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]);var l=n.select(this).attr({x:j,width:Math.max(E,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)p.gradient(l,r,e._id,"vertical",e._fillgradient,"fill");else{var s=C(t).replace("e-","");l.attr("fill",a(s).toHexString())}}));var b=t.select("."+M.cblines).selectAll("path."+M.cbline).data(m.color&&m.width?P:[]);b.enter().append("path").classed(M.cbline,!0),b.exit().remove(),b.each((function(t){n.select(this).attr("d","M"+j+","+(Math.round(Z.c2p(t))+m.width/2%1)+"h"+E).call(p.lineGroupStyle,m.width,S(t),m.dash)})),K.selectAll("g."+Z._id+"tick,path").remove();var _=j+E+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),T=l.calcTicks(Z),k=l.getTickSigns(Z)[2];return l.drawTicks(r,Z,{vals:"inside"===Z.ticks?l.clipEnds(Z,T):T,layer:K,path:l.makeTickPath(Z,_,k),transFn:l.makeTransTickFn(Z)}),l.drawLabels(r,Z,{vals:T,layer:K,transFn:l.makeTransTickLabelFn(Z),labelFns:l.makeLabelFns(Z,_)})},function(){if(-1===["top","bottom"].indexOf(A)){var t=Z.title.font.size,e=Z._offset+Z._length/2,a=s.l+(Z.position||0)*s.w+("right"===Z.side?10+t*(Z.showticklabels?1:.5):-10-t*(Z.showticklabels?.5:0));et("h"+Z._id+"title",{avoid:{selection:n.select(r).selectAll("g."+Z._id+"tick"),side:A,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=E+e.outlinewidth/2;if(-1===Z.ticklabelposition.indexOf("inside")&&(n+=p.bBox(K.node()).width),(J=$.select("text")).node()&&!J.classed(M.jsPlaceholder)){var a,o=$.select(".h"+Z._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(A)?p.bBox(o).width:p.bBox($.node()).right-j-s.l,n=Math.max(n,a)}var l=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,c=q-G;t.select("."+M.cbbg).attr({x:j-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:G-B,width:Math.max(l,2),height:Math.max(c+2*B,2)}).call(h.fill,e.bgcolor).call(h.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+M.cboutline).attr({x:j,y:G+e.ypad+("top"===A?tt:0),width:Math.max(E,2),height:Math.max(c-2*e.ypad-tt,2)}).call(h.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var f=({center:.5,right:1}[e.xanchor]||0)*l;t.attr("transform",u(s.l-f,s.t));var d={},g=T[e.yanchor],v=k[e.yanchor];"pixels"===e.lenmode?(d.y=e.y,d.t=c*g,d.b=c*v):(d.t=d.b=0,d.yt=e.y+e.len*g,d.yb=e.y-e.len*v);var m=T[e.xanchor],y=k[e.xanchor];if("pixels"===e.thicknessmode)d.x=e.x,d.l=l*m,d.r=l*y;else{var x=l-E;d.l=x*m,d.r=x*y,d.xl=e.x-e.thickness*m,d.xr=e.x+e.thickness*y}i.autoMargin(r,e._id,d)}],r)}(r,e,t);m&&m.then&&(t._promises||[]).push(m),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,l=r._fullLayout._size;s.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),d(t)},moveFn:function(r,o){t.attr("transform",n+u(r,o)),a=s.align(e._xLeftFrac+r/l.w,e._thickFrac,0,1,e.xanchor),i=s.align(e._yBottomFrac-o/l.h,e._lenFrac,0,1,e.yanchor);var c=s.getCursor(a,i,e.xanchor,e.yanchor);d(t,c)},doneFn:function(){if(d(t),void 0!==a&&void 0!==i){var n={};n[e._propPrefix+"x"]=a,n[e._propPrefix+"y"]=i,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":207,"../../lib":233,"../../lib/extend":227,"../../lib/setcursor":253,"../../lib/svg_text_utils":255,"../../plots/cartesian/axes":279,"../../plots/cartesian/axis_defaults":281,"../../plots/cartesian/layout_attributes":293,"../../plots/cartesian/position_defaults":296,"../../plots/plots":313,"../../registry":326,"../color":105,"../colorscale/helpers":116,"../dragelement":124,"../drawing":127,"../titles":200,"./constants":107,d3:21,tinycolor2:88}],110:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":233}],111:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":106,"./defaults":108,"./draw":109,"./has_colorbar":110}],112:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("./scales.js").scales;Object.keys(i);function o(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,l=(e=e||{}).cLetter||"c",s=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===l,u="string"==typeof e.colorscaleDflt?i[e.colorscaleDflt]:null,f=e.editTypeOverride||"",d=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):o(d+(r={z:"z",c:"color"}[l]));var p=l+"auto",h=l+"min",g=l+"max",v=l+"mid",m=(o(d+p),o(d+h),o(d+g),{});m[h]=m[g]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),e.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":249,"../colorbar/attributes":106,"./scales.js":120}],113:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,l=t._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(e,c).get():e,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,s)},m=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=v():d&&(p=u._colorAx&&n(p)?Math.min(p,v()):v()),void 0===h?h=m():d&&(h=u._colorAx&&n(h)?Math.max(h,m()):m()),d&&void 0!==g&&(h-g>g-p?p=g-(h-g):h-g<g-p&&(h=g+(g-p))),p===h&&(p-=.5,h+=.5),f._sync("min",p),f._sync("max",h),f.autocolorscale)&&(o=p*h<0?l.colorscale.diverging:p>=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":233,"./helpers":116,"fast-isnumeric":23}],114:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./helpers").hasColorscale,i=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,a){var o=a.container?n.nestedProperty(t,a.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l<t.length;l++){var s=t[l],c=s._module.colorbar;if(c)if(Array.isArray(c))for(var u=0;u<c.length;u++)o(s,c[u]);else o(s,c);a(s,"marker.line")&&o(s,{container:"marker.line",min:"cmin",max:"cmax"})}for(var f in e._colorAxes)o(e[f],{min:"cmin",max:"cmax"})}},{"../../lib":233,"./helpers":116}],115:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),l=t("./scales").isValid,s=t("../../registry").traceIs;function c(t,e){var r=e.slice(0,e.length-1);return e?a.nestedProperty(t,r).get()||{}:t}e.exports=function t(e,r,u,f,d){var p=d.prefix,h=d.cLetter,g="_module"in r,v=c(e,p),m=c(r,p),y=c(r._template||{},p)||{},x=function(){return delete e.coloraxis,delete r.coloraxis,t(e,r,u,f,d)};if(g){var b=u._colorAxes||{},_=f(p+"coloraxis");if(_){var w=s(r,"contour")&&a.nestedProperty(r,"contours.coloring").get()||"heatmap",T=b[_];return void(T?(T[2].push(x),T[0]!==w&&(T[0]=!1,a.warn(["Ignoring coloraxis:",_,"setting","as it is linked to incompatible colorscales."].join(" ")))):b[_]=[w,r,[x]])}}var k=v[h+"min"],M=v[h+"max"],A=n(k)&&n(M)&&k<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":233,"../../registry":326,"../colorbar/defaults":108,"../colorbar/has_colorbar":110,"./scales":120,"fast-isnumeric":23}],116:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("fast-isnumeric"),o=t("../../lib"),l=t("../color"),s=t("./scales").isValid;var c=["showscale","autocolorscale","colorscale","reversescale","colorbar"],u=["min","max","mid","auto"];function f(t){var e,r,n,a=t._colorAx,i=a||t,o={};for(r=0;r<c.length;r++)o[n=c[r]]=i[n];if(a)for(e="c",r=0;r<u.length;r++)o[n=u[r]]=i["c"+n];else{var l;for(r=0;r<u.length;r++)((l="c"+(n=u[r]))in i||(l="z"+n)in i)&&(o[n]=i[l]);e=l.charAt(0)}return o._sync=function(t,r){var n=-1!==u.indexOf(t)?e+t:t;i[n]=i["_"+n]=r},o}function d(t){for(var e=f(t),r=e.min,n=e.max,a=e.reversescale?p(e.colorscale):e.colorscale,i=a.length,o=new Array(i),l=new Array(i),s=0;s<i;s++){var c=a[s];o[s]=r+c[0]*(n-r),l[s]=c[1]}return{domain:o,range:l}}function p(t){for(var e=t.length,r=new Array(e),n=e-1,a=0;n>=0;n--,a++){var i=t[n];r[a]=[1-i[0],i[1]]}return r}function h(t,e){e=e||{};for(var r=t.domain,o=t.range,s=o.length,c=new Array(s),u=0;u<s;u++){var f=a(o[u]).toRgb();c[u]=[f.r,f.g,f.b,f.a]}var d,p=n.scale.linear().domain(r).range(c).clamp(!0),h=e.noNumericCheck,v=e.returnArray;return(d=h&&v?p:h?function(t){return g(p(t))}:v?function(t){return i(t)?p(t):a(t).isValid()?t:l.defaultLine}:function(t){return i(t)?g(p(t)):a(t).isValid()?t:l.defaultLine}).domain=p.domain,d.range=function(){return o},d}function g(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return a(e).toRgbString()}e.exports={hasColorscale:function(t,e,r){var n=e?o.nestedProperty(t,e).get()||{}:t,a=n[r||"color"],l=!1;if(o.isArrayOrTypedArray(a))for(var c=0;c<a.length;c++)if(i(a[c])){l=!0;break}return o.isPlainObject(n)&&(l||!0===n.showscale||i(n.cmin)&&i(n.cmax)||s(n.colorscale)||o.isPlainObject(n.colorbar))},extractOpts:f,extractScale:d,flipScale:p,makeColorScaleFunc:h,makeColorScaleFuncFromTrace:function(t,e){return h(d(t),e)}}},{"../../lib":233,"../color":105,"./scales":120,d3:21,"fast-isnumeric":23,tinycolor2:88}],117:[function(t,e,r){"use strict";var n=t("./scales"),a=t("./helpers");e.exports={moduleType:"component",name:"colorscale",attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),handleDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc"),scales:n.scales,defaultScale:n.defaultScale,getScale:n.get,isValidScale:n.isValid,hasColorscale:a.hasColorscale,extractOpts:a.extractOpts,extractScale:a.extractScale,flipScale:a.flipScale,makeColorScaleFunc:a.makeColorScaleFunc,makeColorScaleFuncFromTrace:a.makeColorScaleFuncFromTrace}},{"./attributes":112,"./calc":113,"./cross_trace_defaults":114,"./defaults":115,"./helpers":116,"./layout_attributes":118,"./layout_defaults":119,"./scales":120}],118:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat,a=t("./attributes"),i=t("./scales").scales;e.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:i.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:i.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:i.RdBu,editType:"calc"}},coloraxis:n({_isSubplotObj:!0,editType:"calc"},a("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}},{"../../lib/extend":227,"./attributes":112,"./scales":120}],119:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plot_api/plot_template"),i=t("./layout_attributes"),o=t("./defaults");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("colorscale.sequential"),r("colorscale.sequentialminus"),r("colorscale.diverging");var l,s,c=e._colorAxes;function u(t,e){return n.coerce(l,s,i.coloraxis,t,e)}for(var f in c){var d=c[f];if(d[0])l=t[f]||{},(s=a.newContainer(e,f,"coloraxis"))._name=f,o(l,s,e,u,{prefix:"",cLetter:"c"});else{for(var p=0;p<d[2].length;p++)d[2][p]();delete e._colorAxes[f]}}}},{"../../lib":233,"../../plot_api/plot_template":268,"./defaults":115,"./layout_attributes":118}],120:[function(t,e,r){"use strict";var n=t("tinycolor2"),a={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},i=a.RdBu;function o(t){var e=0;if(!Array.isArray(t)||t.length<2)return!1;if(!t[0]||!t[t.length-1])return!1;if(0!=+t[0][0]||1!=+t[t.length-1][0])return!1;for(var r=0;r<t.length;r++){var a=t[r];if(2!==a.length||+a[0]<e||!n(a[1]).isValid())return!1;e=+a[0]}return!0}e.exports={scales:a,defaultScale:i,get:function(t,e){if(e||(e=i),!t)return e;function r(){try{t=a[t]||JSON.parse(t)}catch(r){t=e}}return"string"==typeof t&&(r(),"string"==typeof t&&r()),o(t)?t:e},isValid:function(t){return void 0!==a[t]||o(t)}}},{tinycolor2:88}],121:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,a){var i=(t-r)/(n-r),o=i+e/(n-r),l=(i+o)/2;return"left"===a||"bottom"===a?i:"center"===a||"middle"===a?l:"right"===a||"top"===a?o:i<2/3-l?i:o>4/3-l?o:l}},{}],122:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,i){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":233}],123:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],124:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),a=t("has-hover"),i=t("has-passive-events"),o=t("../../lib").removeElement,l=t("../../plots/cartesian/constants"),s=e.exports={};s.align=t("./align"),s.getCursor=t("./cursor");var c=t("./unhover");function u(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function f(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(t){var e,r,n,c,d,p,h,g,v=t.gd,m=1,y=v._context.doubleClickDelay,x=t.element;v._mouseDownTime||(v._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=t.clampFn||function(t,e,r){return Math.abs(t)<r&&(t=0),Math.abs(e)<r&&(e=0),[t,e]};function _(i){v._dragged=!1,v._dragging=!0;var o=f(i);e=o[0],r=o[1],h=i.target,p=i,g=2===i.buttons||i.ctrlKey,"undefined"==typeof i.clientX&&"undefined"==typeof i.clientY&&(i.clientX=e,i.clientY=r),(n=(new Date).getTime())-v._mouseDownTime<y?m+=1:(m=1,v._mouseDownTime=n),t.prepFn&&t.prepFn(i,e,r),a&&!g?(d=u()).style.cursor=window.getComputedStyle(x).cursor:a||(d=document,c=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(x).cursor),document.addEventListener("mouseup",T),document.addEventListener("touchend",T),!1!==t.dragmode&&(i.preventDefault(),document.addEventListener("mousemove",w),document.addEventListener("touchmove",w,{passive:!1}))}function w(n){n.preventDefault();var a=f(n),i=t.minDrag||l.MINDRAG,o=b(a[0]-e,a[1]-r,i),c=o[0],u=o[1];(c||u)&&(v._dragged=!0,s.unhover(v)),v._dragged&&t.moveFn&&!g&&(v._dragdata={element:x,dx:c,dy:u},t.moveFn(c,u))}function T(e){if(delete v._dragdata,!1!==t.dragmode&&(e.preventDefault(),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",w)),document.removeEventListener("mouseup",T),document.removeEventListener("touchend",T),a?o(d):c&&(d.documentElement.style.cursor=c,c=null),v._dragging){if(v._dragging=!1,(new Date).getTime()-v._mouseDownTime>y&&(m=Math.max(m-1,1)),v._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(m,p),!g){var r;try{r=new MouseEvent("click",e)}catch(t){var n=f(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":233,"../../plots/cartesian/constants":285,"./align":121,"./cursor":122,"./unhover":125,"has-hover":54,"has-passive-events":55,"mouse-event-offset":76}],125:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),l=e.exports={};l.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),l.raw(t,e,r)},l.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/dom":225,"../../lib/events":226,"../../lib/throttle":256,"../fx/constants":139}],126:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],127:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../registry"),l=t("../color"),s=t("../colorscale"),c=t("../../lib"),u=c.strTranslate,f=t("../../lib/svg_text_utils"),d=t("../../constants/xmlns_namespaces"),p=t("../../constants/alignment").LINE_SPACING,h=t("../../constants/interactions").DESELECTDIM,g=t("../../traces/scatter/subtypes"),v=t("../../traces/scatter/make_bubble_size_func"),m=t("../../components/fx/helpers").appendArrayPointValue,y=e.exports={};y.font=function(t,e,r,n){c.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(l.fill,n)},y.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},y.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},y.setRect=function(t,e,r,n,a){t.call(y.setPosition,e,r).call(y.setSize,n,a)},y.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),o=n.c2p(t.y);return!!(a(i)&&a(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",o):e.attr("transform",u(i,o)),!0)},y.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);y.translatePoint(t,a,e,r)}))},y.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},y.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,l=i.xcalendar,s=i.ycalendar,c=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){y.hideOutsideRangePoint(t,n.select(this),r,a,l,s)}))}))}},y.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},y.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";l.stroke(e,n||i.color),y.dashLine(e,s,o)},y.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each((function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=a||i.dash||"";n.select(this).call(l.stroke,r||i.color).call(y.dashLine,s,o)}))},y.dashLine=function(t,e,r){r=+r||0,e=y.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},y.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},y.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(l.fill,e)},y.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(l.fill,t[0].trace.fillcolor)}))};var x=t("./symbol_defs");y.symbolNames=[],y.symbolFuncs=[],y.symbolNeedLines={},y.symbolNoDot={},y.symbolNoFill={},y.symbolList=[],Object.keys(x).forEach((function(t){var e=x[t],r=e.n;y.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),y.symbolNames[r]=t,y.symbolFuncs[r]=e.f,e.needLine&&(y.symbolNeedLines[r]=!0),e.noDot?y.symbolNoDot[r]=!0:y.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(y.symbolNoFill[r]=!0)}));var b=y.symbolNames.length;function _(t,e){var r=t%100;return y.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}y.symbolNumber=function(t){if(a(t))t=+t;else if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=y.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=b||t>=400?0:Math.floor(Math.max(t,0))};var w={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0},k=n.format("~.1f"),M={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:w},horizontalreversed:{node:"linearGradient",attrs:w,reversed:!0},vertical:{node:"linearGradient",attrs:T},verticalreversed:{node:"linearGradient",attrs:T,reversed:!0}};y.gradient=function(t,e,r,a,o,s){for(var u=o.length,f=M[a],d=new Array(u),p=0;p<u;p++)f.reversed?d[u-1-p]=[k(100*(1-o[p][0])),o[p][1]]:d[p]=[k(100*o[p][0]),o[p][1]];var h=e._fullLayout,g="g"+h._uid+"-"+r,v=h._defs.select(".gradients").selectAll("#"+g).data([a+d.join(";")],c.identity);v.exit().remove(),v.enter().append(f.node).each((function(){var t=n.select(this);f.attrs&&t.attr(f.attrs),t.attr("id",g);var e=t.selectAll("stop").data(d);e.exit().remove(),e.enter().append("stop"),e.each((function(t){var e=i(t[1]);n.select(this).attr({offset:t[0]+"%","stop-color":l.tinyRGB(e),"stop-opacity":e.getAlpha()})}))})),t.style(s,E(g,e)).style(s+"-opacity",null);var m=function(t){return"."+t.attr("class").replace(/\s/g,".")},y=m(n.select(t.node().parentNode))+">"+m(t);h._gradientUrlQueryParts[y]=1},y.initGradients=function(t){var e=t._fullLayout;c.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},y.pointStyle=function(t,e,r){if(t.size()){var a=y.makePointStyleFns(e);t.each((function(t){y.singlePointStyle(t,n.select(this),e,a,r)}))}},y.singlePointStyle=function(t,e,r,n,a){var i=r.marker,o=i.line;if(e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?i.opacity:t.mo),n.ms2mrc){var s;s="various"===t.ms||"various"===i.size?3:n.ms2mrc(t.ms),t.mrc=s,n.selectedSizeFn&&(s=t.mrc=n.selectedSizeFn(t));var u=y.symbolNumber(t.mx||i.symbol)||0;t.om=u%200>=100,e.attr("d",_(u,s))}var f,d,p,h=!1;if(t.so)p=o.outlierwidth,d=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;p=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in t?t.mlcc=n.lineScale(t.mlc):c.isArrayOrTypedArray(o.color)?l.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(f=l.defaultLine,h=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:p)+"px");var v=i.gradient,m=t.mgt;if(m?h=!0:m=v&&v.type,Array.isArray(m)&&(m=m[0],M[m]||(m=0)),m&&"none"!==m){var x=t.mgc;x?h=!0:x=v.color;var b=r.uid;h&&(b+="-"+t.i),y.gradient(e,a,b,m,[[0,x],[1,f]],"fill")}else l.fill(e,f);p&&l.stroke(e,d)}},y.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=y.tryColorscale(r,""),e.lineScale=y.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=g.isBubble(t)?v(t):function(){return(r.size||6)/2}),t.selectedpoints&&c.extendFlat(e,y.makeSelectedPointStyleFns(t)),e},y.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},i=r.marker||{},l=n.marker||{},s=a.opacity,u=i.opacity,f=l.opacity,d=void 0!==u,p=void 0!==f;(c.isArrayOrTypedArray(s)||d||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?d?u:e:p?f:h*e});var g=a.color,v=i.color,m=l.color;(v||m)&&(e.selectedColorFn=function(t){var e=t.mcc||g;return t.selected?v||e:m||e});var y=a.size,x=i.size,b=l.size,_=void 0!==x,w=void 0!==b;return o.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?x/2:e:w?b/2:e}),e},y.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,c=i.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?c||e:u||(c?e:l.addOpacity(e,h))},e},y.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=y.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&i.push((function(t,e){l.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&i.push((function(t,e){var n=e.mx||a.symbol||0,i=r.selectedSizeFn(e);t.attr("d",_(y.symbolNumber(n),i)),e.mrc2=i})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r<i.length;r++)i[r](e,t)}))}},y.tryColorscale=function(t,e){var r=e?c.nestedProperty(t,e).get():t;if(r){var n=r.color;if((r.colorscale||r._colorAx)&&c.isArrayOrTypedArray(n))return s.makeColorScaleFuncFromTrace(r)}return c.identity};var A={start:1,end:-1,middle:0,bottom:1,top:-1};function L(t,e,r,a){var i=n.select(t.node().parentNode),o=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",l=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",s=a?a/.8+1:0,c=(f.lineCount(t)-1)*p+1,d=A[l]*s,h=.75*r+A[o]*s+(A[o]-1)*c*r/2;t.attr("text-anchor",l),i.attr("transform",u(d,h))}function S(t,e){var r=t.ts||e.textfont.size;return a(r)&&r>0?r:0}y.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var i=y.makeSelectedTextStyleFns(e);a=i.selectedTextColorFn}var o=e.texttemplate,l=r._fullLayout;t.each((function(t){var i=n.select(this),s=o?c.extractOption(t,e,"txt","texttemplate"):c.extractOption(t,e,"tx","text");if(s||0===s){if(o){var u=e._module.formatLabels?e._module.formatLabels(t,e,l):{},d={};m(d,e,t.i);var p=e._meta||{};s=c.texttemplateString(s,u,l._d3locale,d,t,p)}var h=t.tp||e.textposition,g=S(t,e),v=a?a(t):t.tc||e.textfont.color;i.call(y.font,t.tf||e.textfont.family,g,v).text(s).call(f.convertToTspans,r).call(L,h,g,t.mrc)}else i.remove()}))}},y.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=y.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=S(t,e);l.fill(a,i),L(a,o,s,t.mrc2||t.mrc)}))}};function C(t,e,r,a){var i=t[0]-e[0],o=t[1]-e[1],l=r[0]-e[0],s=r[1]-e[1],c=Math.pow(i*i+o*o,.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(e[0]+(p&&f/p),2),n.round(e[1]+(p&&d/p),2)],[n.round(e[0]-(h&&f/h),2),n.round(e[1]-(h&&d/h),2)]]}y.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r<t.length-1;r++)a.push(C(t[r-1],t[r],t[r+1],e));for(n+="Q"+a[0][0]+" "+t[1],r=2;r<t.length-1;r++)n+="C"+a[r-2][1]+" "+a[r-1][0]+" "+t[r];return n+="Q"+a[t.length-3][1]+" "+t[t.length-1]},y.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,n="M"+t[0],a=t.length-1,i=[C(t[a],t[0],t[1],e)];for(r=1;r<a;r++)i.push(C(t[r-1],t[r],t[r+1],e));for(i.push(C(t[a-1],t[a],t[0],e)),r=1;r<=a;r++)n+="C"+i[r-1][1]+" "+i[r][0]+" "+t[r];return n+="C"+i[a][1]+" "+i[0][0]+" "+t[0]+"Z"};var O={hv:function(t,e){return"H"+n.round(e[0],2)+"V"+n.round(e[1],2)},vh:function(t,e){return"V"+n.round(e[1],2)+"H"+n.round(e[0],2)},hvh:function(t,e){return"H"+n.round((t[0]+e[0])/2,2)+"V"+n.round(e[1],2)+"H"+n.round(e[0],2)},vhv:function(t,e){return"V"+n.round((t[1]+e[1])/2,2)+"H"+n.round(e[0],2)+"V"+n.round(e[1],2)}},D=function(t,e){return"L"+n.round(e[0],2)+","+n.round(e[1],2)};y.steps=function(t){var e=O[t]||D;return function(t){for(var r="M"+n.round(t[0][0],2)+","+n.round(t[0][1],2),a=1;a<t.length;a++)r+=e(t[a-1],t[a]);return r}},y.makeTester=function(){var t=c.ensureSingleById(n.select("body"),"svg","js-plotly-tester",(function(t){t.attr(d.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})})),e=c.ensureSingle(t,"path","js-reference-point",(function(t){t.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})}));y.tester=t,y.testref=e},y.savedBBoxes={};var z=0;function P(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}function E(t,e){if(!t)return null;var r=e._context;return"url('"+(r._exportedPlot?"":r._baseUrl||"")+"#"+t+"')"}y.bBox=function(t,e,r){var a,i,o;if(r||(r=P(t)),r){if(a=y.savedBBoxes[r])return c.extendFlat({},a)}else if(1===t.childNodes.length){var l=t.childNodes[0];if(r=P(l)){var s=+l.getAttribute("x")||0,u=+l.getAttribute("y")||0,d=l.getAttribute("transform");if(!d){var p=y.bBox(l,!1,r);return s&&(p.left+=s,p.right+=s),u&&(p.top+=u,p.bottom+=u),p}if(r+="~"+s+"~"+u+"~"+d,a=y.savedBBoxes[r])return c.extendFlat({},a)}}e?i=t:(o=y.tester.node(),i=t.cloneNode(!0),o.appendChild(i)),n.select(i).attr("transform",null).call(f.positionText,0,0);var h=i.getBoundingClientRect(),g=y.testref.node().getBoundingClientRect();e||o.removeChild(i);var v={height:h.height,width:h.width,left:h.left-g.left,top:h.top-g.top,right:h.right-g.left,bottom:h.bottom-g.top};return z>=1e4&&(y.savedBBoxes={},z=0),r&&(y.savedBBoxes[r]=v),z++,c.extendFlat({},v)},y.setClipUrl=function(t,e,r){t.attr("clip-path",E(e,r))},y.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},y.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=u(e,r)).trim(),t[a]("transform",i),i},y.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},y.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+e+","+r+")").trim(),t[a]("transform",i),i};var I=/\s*sc.*/;y.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(I,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var R=/translate\([^)]*\)\s*$/;y.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(R);t=1===e&&1===r?[]:[u(o,l),"scale("+e+","+r+")",u(-o,-l)],s&&t.push(s),a.attr("transform",t.join(""))}}))}},{"../../components/fx/helpers":141,"../../constants/alignment":207,"../../constants/interactions":211,"../../constants/xmlns_namespaces":213,"../../lib":233,"../../lib/svg_text_utils":255,"../../registry":326,"../../traces/scatter/make_bubble_size_func":464,"../../traces/scatter/subtypes":472,"../color":105,"../colorscale":117,"./symbol_defs":128,d3:21,"fast-isnumeric":23,tinycolor2:88}],128:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,a="l"+e+",-"+e,i="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),a=n.round(-t,2),i=n.round(-.309*t,2);return"M"+e+","+i+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),a=n.round(.951*e,2),i=n.round(.363*e,2),o=n.round(.588*e,2),l=n.round(-e,2),s=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+a+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+a+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-down":{n:46,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-left":{n:47,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L-"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L-"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{d3:21}],129:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],130:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),l=t("./compute_error");function s(t,e,r,a){var s=e["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f<t.length;f++){var d=t[f],p=d.i;if(void 0===p)p=f;else if(null===p)continue;var h=d[a];if(n(r.c2l(h))){var g=u(h,p);if(n(g[0])&&n(g[1])){var v=d[a+"s"]=h-g[0],m=d[a+"h"]=h+g[1];c.push(v,m)}}}var y=r._id,x=e._extremes[y],b=i.findExtremes(r,c,o.extendFlat({tozero:x.opts.tozero},{padded:!0}));x.min=x.min.concat(b.min),x.max=x.max.concat(b.max)}}e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var n=e[r],o=n[0].trace;if(!0===o.visible&&a.traceIs(o,"errorBarsOK")){var l=i.getFromId(t,o.xaxis),c=i.getFromId(t,o.yaxis);s(n,o,l,"x"),s(n,o,c,"y")}}}},{"../../lib":233,"../../plots/cartesian/axes":279,"../../registry":326,"./compute_error":131,"fast-isnumeric":23}],131:[function(t,e,r){"use strict";function n(t,e){return"percent"===t?function(t){return Math.abs(t*e/100)}:"constant"===t?function(){return Math.abs(e)}:"sqrt"===t?function(t){return Math.sqrt(Math.abs(t))}:void 0}e.exports=function(t){var e=t.type,r=t.symmetric;if("data"===e){var a=t.array||[];if(r)return function(t,e){var r=+a[e];return[r,r]};var i=t.arrayminus||[];return function(t,e){var r=+a[e],n=+i[e];return isNaN(r)&&isNaN(n)?[NaN,NaN]:[n||0,r||0]}}var o=n(e,t.value),l=n(e,t.valueminus);return r||void 0===t.valueminus?function(t){var e=o(t);return[e,e]}:function(t){return[l(t),o(t)]}}},{}],132:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../lib"),o=t("../../plot_api/plot_template"),l=t("./attributes");e.exports=function(t,e,r,s){var c="error_"+s.axis,u=o.newContainer(e,c),f=t[c]||{};function d(t,e){return i.coerce(f,u,l,t,e)}if(!1!==d("visible",void 0!==f.array||void 0!==f.value||"sqrt"===f.type)){var p=d("type","array"in f?"data":"percent"),h=!0;"sqrt"!==p&&(h=d("symmetric",!(("data"===p?"arrayminus":"valueminus")in f))),"data"===p?(d("array"),d("traceref"),h||(d("arrayminus"),d("tracerefminus"))):"percent"!==p&&"constant"!==p||(d("value"),h||d("valueminus"));var g="copy_"+s.inherit+"style";if(s.inherit)(e["error_"+s.inherit]||{}).visible&&d(g,!(f.color||n(f.thickness)||n(f.width)));s.inherit&&u[g]||(d("color",r),d("thickness"),d("width",a.traceIs(e,"gl3d")?0:4))}}},{"../../lib":233,"../../plot_api/plot_template":268,"../../registry":326,"./attributes":129,"fast-isnumeric":23}],133:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plot_api/edit_types").overrideAll,i=t("./attributes"),o={error_x:n.extendFlat({},i),error_y:n.extendFlat({},i)};delete o.error_x.copy_zstyle,delete o.error_y.copy_zstyle,delete o.error_y.copy_ystyle;var l={error_x:n.extendFlat({},i),error_y:n.extendFlat({},i),error_z:n.extendFlat({},i)};delete l.error_x.copy_ystyle,delete l.error_y.copy_ystyle,delete l.error_z.copy_ystyle,delete l.error_z.copy_zstyle,e.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:o,bar:o,histogram:o,scatter3d:a(l,"calc","nested"),scattergl:a(o,"calc","nested")}},supplyDefaults:t("./defaults"),calc:t("./calc"),makeComputeError:t("./compute_error"),plot:t("./plot"),style:t("./style"),hoverInfo:function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys));(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}}},{"../../lib":233,"../../plot_api/edit_types":261,"./attributes":129,"./calc":130,"./compute_error":131,"./defaults":132,"./plot":134,"./style":135}],134:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../drawing"),o=t("../../traces/scatter/subtypes");e.exports=function(t,e,r,l){var s=r.xaxis,c=r.yaxis,u=l&&l.duration>0;e.each((function(e){var f,d=e[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(t){return t.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,f);if(v.exit().remove(),e.length){p.visible||v.selectAll("path.xerror").remove(),h.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,t),v.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0)));void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),a(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,s,c);if(!g||t.vis){var i,o=e.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var d=e.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!d.size()?d=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(d=d.transition().duration(l.duration).ease(l.easing)),d.attr("d",i)}else d.remove()}}))}}))}},{"../../traces/scatter/subtypes":472,"../drawing":127,d3:21,"fast-isnumeric":23}],135:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":105,d3:21}],136:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("./layout_attributes").hoverlabel,i=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":227,"../../plots/font_attributes":307,"./layout_attributes":146}],137:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");function i(t,e,r,a){a=a||n.identity,Array.isArray(t)&&(e[0][r]=a(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var l=0;l<e.length;l++){var s=e[l],c=s[0].trace;if(!a.traceIs(c,"pie-like")){var u=a.traceIs(c,"2dMap")?i:n.fillArray;u(c.hoverinfo,s,"hi",o(c)),c.hovertemplate&&u(c.hovertemplate,s,"ht"),c.hoverlabel&&(u(c.hoverlabel.bgcolor,s,"hbg"),u(c.hoverlabel.bordercolor,s,"hbc"),u(c.hoverlabel.font.size,s,"hts"),u(c.hoverlabel.font.color,s,"htc"),u(c.hoverlabel.font.family,s,"htf"),u(c.hoverlabel.namelength,s,"hnl"),u(c.hoverlabel.align,s,"hta"))}}}},{"../../lib":233,"../../registry":326}],138:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./hover").hover;e.exports=function(t,e,r){var i=n.getComponentMethod("annotations","onClick")(t,t._hoverdata);function o(){t.emit("plotly_click",{points:t._hoverdata,event:e})}void 0!==r&&a(t,e,r,!0),t._hoverdata&&e&&e.target&&(i&&i.then?i.then(o):o(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}},{"../../registry":326,"./hover":142}],139:[function(t,e,r){"use strict";e.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}},{}],140:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./hoverlabel_defaults");e.exports=function(t,e,r,o){var l=n.extendFlat({},o.hoverlabel);e.hovertemplate&&(l.namelength=-1),i(t,e,(function(r,i){return n.coerce(t,e,a,r,i)}),l)}},{"../../lib":233,"./attributes":136,"./hoverlabel_defaults":143}],141:[function(t,e,r){"use strict";var n=t("../../lib");r.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},r.isTraceInSubplots=function(t,e){if("splom"===t.type){for(var n=t.xaxes||[],a=t.yaxes||[],i=0;i<n.length;i++)for(var o=0;o<a.length;o++)if(-1!==e.indexOf(n[i]+a[o]))return!0;return!1}return-1!==e.indexOf(r.getSubplot(t))},r.flat=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=e;return r},r.p2c=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=t[n].p2c(e);return r},r.getDistanceFunction=function(t,e,n,a){return"closest"===t?a||r.quadrature(e,n):"x"===t.charAt(0)?e:n},r.getClosest=function(t,e,r){if(!1!==r.index)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=0;n<t.length;n++){var a=e(t[n]);a<=r.distance&&(r.index=n,r.distance=a)}return r},r.inbox=function(t,e,r){return t*e<0||0===t?r:1/0},r.quadrature=function(t,e){return function(r){var n=t(r),a=e(r);return Math.sqrt(n*n+a*a)}},r.makeEventData=function(t,e,n){var a="index"in t?t.index:t.pointNumber,i={data:e._input,fullData:e,curveNumber:e.index,pointNumber:a};if(e._indexToPoints){var o=e._indexToPoints[a];1===o.length?i.pointIndex=o[0]:i.pointIndices=o}else i.pointIndex=a;return e._module.eventData?i=e._module.eventData(i,t,e,n,a):("xVal"in t?i.x=t.xVal:"x"in t&&(i.x=t.x),"yVal"in t?i.y=t.yVal:"y"in t&&(i.y=t.y),t.xa&&(i.xaxis=t.xa),t.ya&&(i.yaxis=t.ya),void 0!==t.zLabelVal&&(i.z=t.zLabelVal)),r.appendArrayPointValue(i,e,a),i},r.appendArrayPointValue=function(t,e,r){var a=e._arrayAttrs;if(a)for(var l=0;l<a.length;l++){var s=a[l],c=i(s);if(void 0===t[c]){var u=o(n.nestedProperty(e,s).get(),r);void 0!==u&&(t[c]=u)}}},r.appendArrayMultiPointValues=function(t,e,r){var a=e._arrayAttrs;if(a)for(var l=0;l<a.length;l++){var s=a[l],c=i(s);if(void 0===t[c]){for(var u=n.nestedProperty(e,s).get(),f=new Array(r.length),d=0;d<r.length;d++)f[d]=o(u,r[d]);t[c]=f}}};var a={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function i(t){return a[t]||t}function o(t,e){return Array.isArray(e)?Array.isArray(t)&&Array.isArray(t[e[0]])?t[e[0]][e[1]]:void 0:t[e]}var l={x:!0,y:!0},s={"x unified":!0,"y unified":!0};r.isUnifiedHover=function(t){return"string"==typeof t&&!!s[t]},r.isXYhover=function(t){return"string"==typeof t&&!!l[t]}},{"../../lib":233}],142:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../lib"),l=o.strTranslate,s=o.strRotate,c=t("../../lib/events"),u=t("../../lib/svg_text_utils"),f=t("../../lib/override_cursor"),d=t("../drawing"),p=t("../color"),h=t("../dragelement"),g=t("../../plots/cartesian/axes"),v=t("../../registry"),m=t("./helpers"),y=t("./constants"),x=t("../legend/defaults"),b=t("../legend/draw"),_=y.YANGLE,w=Math.PI*_/180,T=1/Math.sin(w),k=Math.cos(w),M=Math.sin(w),A=y.HOVERARROWSIZE,L=y.HOVERTEXTPAD;function S(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa,t.ya||""].join(",")}r.hover=function(t,e,r,i){t=o.getGraphDiv(t),o.throttle(t._fullLayout._uid+y.HOVERID,y.HOVERMINTIME,(function(){!function(t,e,r,i){r||(r="xy");var l=Array.isArray(r)?r:[r],s=t._fullLayout,u=s._plots||[],d=u[r],g=s._has("cartesian");if(d){var y=d.overlays.map((function(t){return t.id}));l=l.concat(y)}for(var x=l.length,b=new Array(x),_=new Array(x),w=!1,k=0;k<x;k++){var M=l[k];if(u[M])w=!0,b[k]=u[M].xaxis,_[k]=u[M].yaxis;else{if(!s[M]||!s[M]._subplot)return void o.warn("Unrecognized subplot: "+M);var A=s[M]._subplot;b[k]=A.xaxis,_[k]=A.yaxis}}var L=e.hovermode||s.hovermode;L&&!w&&(L="closest");if(-1===["x","y","closest","x unified","y unified"].indexOf(L)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return h.unhoverRaw(t,e);var C,D,R,F,N,B,H,j,U,V,q,G,Z,Y=-1===s.hoverdistance?1/0:s.hoverdistance,X=-1===s.spikedistance?1/0:s.spikedistance,W=[],Q=[],J={hLinePoint:null,vLinePoint:null},$=!1;if(Array.isArray(e))for(L="array",R=0;R<e.length;R++)(N=t.calcdata[e[R].curveNumber||0])&&(B=N[0].trace,"skip"!==N[0].trace.hoverinfo&&(Q.push(N),"h"===B.orientation&&($=!0)));else{for(F=0;F<t.calcdata.length;F++)N=t.calcdata[F],"skip"!==(B=N[0].trace).hoverinfo&&m.isTraceInSubplots(B,l)&&(Q.push(N),"h"===B.orientation&&($=!0));var K,tt;if(!e.target)K="xpx"in e?e.xpx:b[0]._length/2,tt="ypx"in e?e.ypx:_[0]._length/2;else{if(!1===c.triggerHandler(t,"plotly_beforehover",e))return;var et=e.target.getBoundingClientRect();K=e.clientX-et.left,tt=e.clientY-et.top,s._calcInverseTransform(t);var rt=o.apply3DTransform(s._invTransform)(K,tt);if(K=rt[0],tt=rt[1],K<0||K>b[0]._length||tt<0||tt>_[0]._length)return h.unhoverRaw(t,e)}if(e.pointerX=K+b[0]._offset,e.pointerY=tt+_[0]._offset,C="xval"in e?m.flat(l,e.xval):m.p2c(b,K),D="yval"in e?m.flat(l,e.yval):m.p2c(_,tt),!a(C[0])||!a(D[0]))return o.warn("Fx.hover failed",e,t),h.unhoverRaw(t,e)}var nt=1/0;function at(t,r){for(F=0;F<Q.length;F++)if((N=Q[F])&&N[0]&&N[0].trace&&!0===(B=N[0].trace).visible&&0!==B._length&&-1===["carpet","contourcarpet"].indexOf(B._module.name)){if("splom"===B.type?H=l[j=0]:(H=m.getSubplot(B),j=l.indexOf(H)),U=L,m.isUnifiedHover(U)&&(U=U.charAt(0)),G={cd:N,trace:B,xa:b[j],ya:_[j],maxHoverDistance:Y,maxSpikeDistance:X,index:!1,distance:Math.min(nt,Y),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:p.defaultLine,name:B.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},s[H]&&(G.subplot=s[H]._subplot),s._splomScenes&&s._splomScenes[B.uid]&&(G.scene=s._splomScenes[B.uid]),Z=W.length,"array"===U){var n=e[F];"pointNumber"in n?(G.index=n.pointNumber,U="closest"):(U="","xval"in n&&(V=n.xval,U="x"),"yval"in n&&(q=n.yval,U=U?"closest":"y"))}else void 0!==t&&void 0!==r?(V=t,q=r):(V=C[j],q=D[j]);if(0!==Y)if(B._module&&B._module.hoverPoints){var i=B._module.hoverPoints(G,V,q,U,s._hoverlayer);if(i)for(var c,u=0;u<i.length;u++)c=i[u],a(c.x0)&&a(c.y0)&&W.push(P(c,L))}else o.log("Unrecognized trace type in hover:",B);if("closest"===L&&W.length>Z&&(W.splice(0,Z),nt=W[0].distance),g&&0!==X&&0===W.length){G.distance=X,G.index=!1;var f=B._module.hoverPoints(G,V,q,"closest",s._hoverlayer);if(f&&(f=f.filter((function(t){return t.spikeDistance<=X}))),f&&f.length){var d,h=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(h.length){var v=h[0];a(v.x0)&&a(v.y0)&&(d=ot(v),(!J.vLinePoint||J.vLinePoint.spikeDistance>d.spikeDistance)&&(J.vLinePoint=d))}var y=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(d=ot(x),(!J.hLinePoint||J.hLinePoint.spikeDistance>d.spikeDistance)&&(J.hLinePoint=d))}}}}}function it(t,e){for(var r,n=null,a=1/0,i=0;i<t.length;i++)(r=t[i].spikeDistance)<=a&&r<=e&&(n=t[i],a=r);return n}function ot(t){return t?{xa:t.xa,ya:t.ya,x:void 0!==t.xSpike?t.xSpike:(t.x0+t.x1)/2,y:void 0!==t.ySpike?t.ySpike:(t.y0+t.y1)/2,distance:t.distance,spikeDistance:t.spikeDistance,curveNumber:t.trace.index,color:t.color,pointNumber:t.index}:null}at();var lt={fullLayout:s,container:s._hoverlayer,outerContainer:s._paperdiv,event:e},st=t._spikepoints,ct={vLinePoint:J.vLinePoint,hLinePoint:J.hLinePoint};if(t._spikepoints=ct,g&&0!==X&&0!==W.length){var ut=it(W.filter((function(t){return t.ya.showspikes})),X);J.hLinePoint=ot(ut);var ft=it(W.filter((function(t){return t.xa.showspikes})),X);J.vLinePoint=ot(ft)}if(0===W.length){var dt=h.unhoverRaw(t,e);return!g||null===J.hLinePoint&&null===J.vLinePoint||I(st)&&E(t,J,lt),dt}g&&I(st)&&E(t,J,lt);if(W.sort((function(t,e){return t.distance-e.distance})),m.isXYhover(U)&&0!==W[0].length&&"splom"!==W[0].trace.type){var pt=W[0],ht=pt.cd[pt.index],gt="group"===s.boxmode||"group"===s.violinmode,vt=pt.xVal,mt=pt.xa;"category"===mt.type&&(vt=mt._categoriesMap[vt]),"date"===mt.type&&(vt=mt.d2c(vt)),ht&&ht.t&&ht.t.posLetter===mt._id&&gt&&(vt+=ht.t.dPos);var yt=pt.yVal;"category"===(mt=pt.ya).type&&(yt=mt._categoriesMap[yt]),"date"===mt.type&&(yt=mt.d2c(yt)),ht&&ht.t&&ht.t.posLetter===mt._id&&gt&&(yt+=ht.t.dPos),at(vt,yt);var xt={};W=W.filter((function(t){var e=S(t);if(!xt[e])return xt[e]=!0,xt[e]}))}var bt=t._hoverdata,_t=[];for(R=0;R<W.length;R++){var wt=W[R],Tt=m.makeEventData(wt,wt.trace,wt.cd);if(!1!==wt.hovertemplate){var kt=!1;wt.cd[wt.index]&&wt.cd[wt.index].ht&&(kt=wt.cd[wt.index].ht),wt.hovertemplate=kt||wt.trace.hovertemplate||!1}wt.eventData=[Tt],_t.push(Tt)}t._hoverdata=_t;var Mt="y"===L&&(Q.length>1||W.length>1)||"closest"===L&&$&&W.length>1,At=p.combine(s.plot_bgcolor||p.background,s.paper_bgcolor),Lt={hovermode:L,rotateLabels:Mt,bgColor:At,container:s._hoverlayer,outerContainer:s._paperdiv,commonLabelOpts:s.hoverlabel,hoverdistance:s.hoverdistance},St=O(W,Lt,t);m.isUnifiedHover(L)||(!function(t,e,r){var n,a,i,o,l,s,c,u=0,f=1,d=t.size(),p=new Array(d),h=0;function g(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=i;n=!1}if(n){var c=0;for(o=0;o<t.length;o++)(s=t[o]).pos+s.dp+s.size>e.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(s=t[o]).pos>e.pmax-1&&(s.del=!0,c--);for(o=0;o<t.length&&!(c<=0);o++)if((s=t[o]).pos<e.pmin+1)for(s.del=!0,c--,i=2*s.size,l=t.length-1;l>=0;l--)t[l].dp-=i;for(o=t.length-1;o>=0&&!(c<=0);o--)(s=t[o]).pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}t.each((function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?T:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!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 _=b[l],w=_.datum;w.offset=_.dp,w.del=_.del}}}(St,Mt?"xa":"ya",s),z(St,Mt,s._invScaleX,s._invScaleY));if(e.target&&e.target.tagName){var Ct=v.getComponentMethod("annotations","hasClickToShow")(t,_t);f(n.select(e.target),Ct?"pointer":"")}if(!e.target||i||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(t,0,bt))return;bt&&t.emit("plotly_unhover",{event:e,points:bt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:b,yaxes:_,xvals:C,yvals:D})}(t,e,r,i)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var a=t.map((function(t){return{color:t.color||p.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}})),i=n.select(e.container),o=e.outerContainer?n.select(e.outerContainer):i,l={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||p.background,container:i,outerContainer:o},s=O(a,l,e.gd),c=0,u=0;s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5<c?c-n+5:0,c=n+t.by+t.offset,r===e.anchorIndex&&(u=t.offset)})).each((function(t){t.offset-=u}));var f=e.gd._fullLayout._invScaleX,d=e.gd._fullLayout._invScaleY;return z(s,l.rotateLabels,f,d),r?s:s.node()};var C=/<extra>([\s\S]*)<\/extra>/;function O(t,e,r){var a=r._fullLayout,i=e.hovermode,c=e.rotateLabels,f=e.bgColor,h=e.container,g=e.outerContainer,v=e.commonLabelOpts||{},w=e.fontFamily||y.HOVERFONT,T=e.fontSize||y.HOVERFONTSIZE,k=t[0],M=k.xa,C=k.ya,O="y"===i.charAt(0)?"yLabel":"xLabel",z=k[O],P=(String(z)||"").split(" ")[0],E=g.node().getBoundingClientRect(),I=E.top,R=E.width,F=E.height,N=void 0!==z&&k.distance<=e.hoverdistance&&("x"===i||"y"===i);if(N){var B,H,j=!0;for(B=0;B<t.length;B++)if(j&&void 0===t[B].zLabel&&(j=!1),H=t[B].hoverinfo||t[B].trace.hoverinfo){var U=Array.isArray(H)?H:H.split("+");if(-1===U.indexOf("all")&&-1===U.indexOf(i)){N=!1;break}}j&&(N=!1)}var V=h.selectAll("g.axistext").data(N?[0]:[]);function q(t){return t.filter((function(t){return void 0!==t.zLabelVal||(t[O]||"").split(" ")[0]===P}))}if(V.enter().append("g").classed("axistext",!0),V.exit().remove(),V.each((function(){var e=n.select(this),s=o.ensureSingle(e,"path","",(function(t){t.style({"stroke-width":"1px"})})),c=o.ensureSingle(e,"text","",(function(t){t.attr("data-notex",1)})),f=v.bgcolor||p.defaultLine,h=v.bordercolor||p.contrast(f),g=p.contrast(f),m={family:v.font.family||w,size:v.font.size||T,color:v.font.color||g};s.style({fill:f,stroke:h}),c.text(z).call(d.font,m).call(u.positionText,0,0).call(u.convertToTspans,r),e.attr("transform","");var y,x,b=c.node().getBoundingClientRect();if("x"===i){var _="top"===M.side?"-":"";c.attr("text-anchor","middle").call(u.positionText,0,"top"===M.side?I-b.bottom-A-L:I-b.top+A+L),y=M._offset+(k.x0+k.x1)/2,x=C._offset+("top"===M.side?0:C._length);var S=b.width/2+L;y<S?(y=S,s.attr("d","M-"+(S-A)+",0L-"+(S-2*A)+","+_+A+"H"+(L+b.width/2)+"v"+_+(2*L+b.height)+"H-"+S+"V"+_+A+"Z")):y>a.width-S?(y=a.width-S,s.attr("d","M"+(S-A)+",0L"+S+","+_+A+"v"+_+(2*L+b.height)+"H-"+S+"V"+_+A+"H"+(S-2*A)+"Z")):s.attr("d","M0,0L"+A+","+_+A+"H"+(L+b.width/2)+"v"+_+(2*L+b.height)+"H-"+(L+b.width/2)+"V"+_+A+"H-"+A+"Z")}else{var O,D,P;"right"===C.side?(O="start",D=1,P="",y=M._offset+M._length):(O="end",D=-1,P="-",y=M._offset),x=C._offset+(k.y0+k.y1)/2,c.attr("text-anchor",O),s.attr("d","M0,0L"+P+A+","+A+"V"+(L+b.height/2)+"h"+P+(2*L+b.width)+"V-"+(L+b.height/2)+"H"+P+A+"V-"+A+"Z");var E,R=b.height/2,F=I-b.top-R,N="clip"+a._uid+"commonlabel"+C._id;if(y<b.width+2*L+A){E="M-"+(A+L)+"-"+R+"h-"+(b.width-L)+"V"+R+"h"+(b.width-L)+"Z";var B=b.width-y+L;u.positionText(c,B,F),"end"===O&&c.selectAll("tspan").each((function(){var t=n.select(this),e=d.tester.append("text").text(t.text()).call(d.font,m),r=e.node().getBoundingClientRect();Math.round(r.width)<Math.round(b.width)&&t.attr("x",B-r.width),e.remove()}))}else u.positionText(c,D*(L+A),F),E=null;var H=a._topclips.selectAll("#"+N).data(E?[0]:[]);H.enter().append("clipPath").attr("id",N).append("path"),H.exit().remove(),H.select("path").attr("d",E),d.setClipUrl(c,E?N:null,r)}e.attr("transform",l(y,x)),t=q(t)})),m.isUnifiedHover(i)){if(h.selectAll("g.hovertext").remove(),void 0!==z&&k.distance<=e.hoverdistance&&(t=q(t)),0===t.length)return;var G={showlegend:!0,legend:{title:{text:z,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"}},Z={};x(G,Z,r._fullData);var Y=Z.legend;Y.entries=[];for(var X=0;X<t.length;X++){var W=D(t[X],!0,i,a,z),Q=W[0],J=W[1],$=t[X];$.name=J,$.text=""!==J?J+" : "+Q:Q;var K=$.cd[$.index];K&&(K.mc&&($.mc=K.mc),K.mcc&&($.mc=K.mcc),K.mlc&&($.mlc=K.mlc),K.mlcc&&($.mlc=K.mlcc),K.mlw&&($.mlw=K.mlw),K.mrc&&($.mrc=K.mrc),K.dir&&($.dir=K.dir)),$._distinct=!0,Y.entries.push([$])}Y.entries.sort((function(t,e){return t[0].trace.index-e[0].trace.index})),Y.layer=h,b(r,Y);var tt=o.mean(t.map((function(t){return(t.y0+t.y1)/2}))),et=o.mean(t.map((function(t){return(t.x0+t.x1)/2}))),rt=h.select("g.legend"),nt=rt.node().getBoundingClientRect();et+=M._offset,tt+=C._offset-nt.height/2;var at=nt.width+2*L;!(et+at<=R)&&et-at>=0?et-=at:et+=2*L;var it=nt.height+2*L,ot=tt+it>=F;return it<=F&&(tt<=I?tt=C._offset+2*L:ot&&(tt=F-it)),rt.attr("transform",l(et,tt)),rt}var lt=h.selectAll("g.hovertext").data(t,(function(t){return S(t)}));return lt.enter().append("g").classed("hovertext",!0).each((function(){var t=n.select(this);t.append("rect").call(p.fill,p.addOpacity(f,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(d.font,w,T)})),lt.exit().remove(),lt.each((function(t){var e=n.select(this).attr("transform",""),o=t.color;Array.isArray(o)&&(o=o[t.eventData[0].pointNumber]);var h=t.bgcolor||o,g=p.combine(p.opacity(h)?h:p.defaultLine,f),v=p.combine(p.opacity(o)?o:p.defaultLine,f),m=t.borderColor||p.contrast(g),y=D(t,N,i,a,z,e),x=y[0],b=y[1],k=e.select("text.nums").call(d.font,t.fontFamily||w,t.fontSize||T,t.fontColor||m).text(x).attr("data-notex",1).call(u.positionText,0,0).call(u.convertToTspans,r),M=e.select("text.name"),S=0,C=0;if(b&&b!==x){M.call(d.font,t.fontFamily||w,t.fontSize||T,v).text(b).attr("data-notex",1).call(u.positionText,0,0).call(u.convertToTspans,r);var O=M.node().getBoundingClientRect();S=O.width+2*L,C=O.height+2*L}else M.remove(),e.select("rect").remove();e.select("path").style({fill:g,stroke:m});var P,E,B=k.node().getBoundingClientRect(),H=t.xa._offset+(t.x0+t.x1)/2,j=t.ya._offset+(t.y0+t.y1)/2,U=Math.abs(t.x1-t.x0),V=Math.abs(t.y1-t.y0),q=B.width+A+L+S;if(t.ty0=I-B.top,t.bx=B.width+2*L,t.by=Math.max(B.height+2*L,C),t.anchor="start",t.txwidth=B.width,t.tx2width=S,t.offset=0,c)t.pos=H,P=j+V/2+q<=F,E=j-V/2-q>=0,"top"!==t.idealAlign&&P||!E?P?(j+=V/2,t.anchor="start"):t.anchor="middle":(j-=V/2,t.anchor="end");else if(t.pos=j,P=H+U/2+q<=R,E=H-U/2-q>=0,"left"!==t.idealAlign&&P||!E)if(P)H+=U/2,t.anchor="start";else{t.anchor="middle";var G=q/2,Z=H+G-R,Y=H-G;Z>0&&(H-=Z),Y<0&&(H+=-Y)}else H-=U/2,t.anchor="end";k.attr("text-anchor",t.anchor),S&&M.attr("text-anchor",t.anchor),e.attr("transform",l(H,j)+(c?s(_):""))})),lt}function D(t,e,r,n,a,i){var l="",s="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),l=R(t.name,t.nameLength)),void 0!==t.zLabel?(void 0!==t.xLabel&&(s+="x: "+t.xLabel+"<br>"),void 0!==t.yLabel&&(s+="y: "+t.yLabel+"<br>"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(s+=(s?"z: ":"")+t.zLabel)):e&&t[r.charAt(0)+"Label"]===a?s=t[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(s=t.yLabel):s=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(s+=(s?"<br>":"")+t.text),void 0!==t.extraText&&(s+=(s?"<br>":"")+t.extraText),i&&""===s&&!t.hovertemplate&&(""===l&&i.remove(),s=l);var c=n._d3locale,u=t.hovertemplate||!1,f=t.hovertemplateLabels||t,d=t.eventData[0]||{};return u&&(s=(s=o.hovertemplateString(u,f,c,d,t.trace._meta)).replace(C,(function(e,r){return l=R(r,t.nameLength),""}))),[s,l]}function z(t,e,r,a){var i=function(t){return t*r},o=function(t){return t*a};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var a=r.select("text.nums"),l=t.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],f=c*(A+L),p=f+c*(t.txwidth+L),h=0,g=t.offset,v="middle"===l;v&&(f-=t.tx2width/2,p+=t.txwidth/2+L),e&&(g*=-M,h=t.offset*k),r.select("path").attr("d",v?"M-"+i(t.bx/2+t.tx2width/2)+","+o(g-t.by/2)+"h"+i(t.bx)+"v"+o(t.by)+"h-"+i(t.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+g)+"v"+o(t.by/2-A)+"h"+i(s*t.bx)+"v-"+o(t.by)+"H"+i(s*A+h)+"V"+o(g-A)+"Z");var m=h+f,y=g+t.ty0-t.by/2+L,x=t.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==l?(a.attr("text-anchor","start"),m=v?-t.bx/2-t.tx2width/2+L:-t.bx-L):"right"===x&&"end"!==l&&(a.attr("text-anchor","end"),m=v?t.bx/2-t.tx2width/2-L:t.bx+L)),a.call(u.positionText,i(m),o(y)),t.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*L+h),o(g+t.ty0-t.by/2+L)),r.select("rect").call(d.setRect,i(p+(c-1)*t.tx2width/2+h),o(g-t.by/2-1),i(t.tx2width),o(t.by+2)))}))}function P(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],l=t.cd[r]||{};function s(t){return t||a(t)&&0===t}var c=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return s(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(l,n,t,e)};function u(e,r,n){var a=c(r,n);s(a)&&(t[e]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:g.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:g.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=g.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+g.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var d=g.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+d+" / -"+g.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+d,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function E(t,e,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var v,m,y=e.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var x,b,_=i.readability(y.color,h)<1.5?p.contrast(h):y.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||_,M=g.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=M,b=v),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":T,stroke:k,"stroke-dasharray":d.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":T+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==a.side?T:-T),cy:m,r:T,fill:k}).classed("spikeline",!0)}if(f){var S,C,O=e.vLinePoint;n=O&&O.xa,a=O&&O.ya,"cursor"===n.spikesnap?(S=c.pointerX,C=c.pointerY):(S=n._offset+O.x,C=a._offset+O.y);var D,z,P=i.readability(O.color,h)<1.5?p.contrast(h):O.color,E=n.spikemode,I=n.spikethickness,R=n.spikecolor||P,F=g.getPxPosition(t,n);if(-1!==E.indexOf("toaxis")||-1!==E.indexOf("across")){if(-1!==E.indexOf("toaxis")&&(D=F,z=C),-1!==E.indexOf("across")){var N=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),B=Math.max(B,n.position)),D=s.t+(1-B)*s.h,z=s.t+(1-N)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:D,y2:z,"stroke-width":I,stroke:R,"stroke-dasharray":d.dashStyle(n.spikedash,I)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:D,y2:z,"stroke-width":I+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==E.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?I:-I),r:I,fill:R}).classed("spikeline",!0)}}}function I(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function R(t,e){return u.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":233,"../../lib/events":226,"../../lib/override_cursor":244,"../../lib/svg_text_utils":255,"../../plots/cartesian/axes":279,"../../registry":326,"../color":105,"../dragelement":124,"../drawing":127,"../legend/defaults":157,"../legend/draw":158,"./constants":139,"./helpers":141,d3:21,"fast-isnumeric":23,tinycolor2:88}],143:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function l(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&i(e.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),e.legend?(o.bgcolor||(o.bgcolor=a.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.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":233,"../color":105,"./helpers":141}],144:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function i(r,i){return void 0!==e[r]?e[r]:n.coerce(t,e,a,r,i)}var o,l=i("clickmode");return e._has("cartesian")?l.indexOf("select")>-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._scatterStackOpts||{},n=0;n<t.length;n++){var a=t[n],i=a.xaxis+a.yaxis,o=(r[i]||{})[a.stackgroup]||{};if("h"!==a.orientation&&"h"!==o.orientation)return!1}return!0}(r,e),o=e._isHoriz?"y":"x"):o="closest",i("hovermode",o)}},{"../../lib":233,"./layout_attributes":146}],145:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../dragelement"),o=t("./helpers"),l=t("./layout_attributes"),s=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:l},attributes:t("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return a.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return a.castOption(t,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(t){var e=a.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":233,"../dragelement":124,"./attributes":136,"./calc":137,"./click":138,"./constants":139,"./defaults":140,"./helpers":141,"./hover":142,"./layout_attributes":146,"./layout_defaults":147,"./layout_global_defaults":148,d3:21}],146:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","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":307,"./constants":139}],147:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./helpers").isUnifiedHover,i=t("./layout_attributes"),o=t("./hovermode_defaults"),l=t("./hoverlabel_defaults");e.exports=function(t,e,r){function s(r,a){return n.coerce(t,e,i,r,a)}var c=o(t,e,r);c&&(s("hoverdistance"),s("spikedistance",a(c)?-1:void 0)),"select"===s("dragmode")&&s("selectdirection");var u=e._has("mapbox"),f=e._has("geo"),d=e._basePlotModules.length;"zoom"===e.dragmode&&((u||f)&&1===d||u&&f&&2===d)&&(e.dragmode="pan"),l(t,e,s)}},{"../../lib":233,"./helpers":141,"./hoverlabel_defaults":143,"./hovermode_defaults":144,"./layout_attributes":146}],148:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./hoverlabel_defaults"),i=t("./layout_attributes");e.exports=function(t,e){a(t,e,(function(r,a){return n.coerce(t,e,i,r,a)}))}},{"../../lib":233,"./hoverlabel_defaults":143,"./layout_attributes":146}],149:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../lib/regex").counter,i=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,l=t("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(t,e,r){var n=e[r+"axes"],a=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(t,e,r,n,a,i){var o=e(t+"gap",r),l=e("domain."+t);e(t+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),f=u*(1-o),d=0;d<a;d++){var p=c+u*d;s[i?a-1-d:d]=[p,p+f]}return s}function f(t,e,r,n,a){var i,o=new Array(r);function l(t,r){-1!==e.indexOf(r)&&void 0===n[r]?(o[t]=r,n[r]=t):o[t]=""}if(Array.isArray(t))for(i=0;i<r;i++)l(i,t[i]);else for(l(0,a),i=1;i<r;i++)l(i,a+(i+1));return o}e.exports={moduleType:"component",name:"grid",schema:{layout:{grid:s}},layoutAttributes:s,sizeDefaults:function(t,e){var r=t.grid||{},a=c(e,r,"x"),i=c(e,r,"y");if(t.grid||a||i){var o,f,d=Array.isArray(r.subplots)&&Array.isArray(r.subplots[0]),p=Array.isArray(a),h=Array.isArray(i),g=p&&a!==r.xaxes&&h&&i!==r.yaxes;d?(o=r.subplots.length,f=r.subplots[0].length):(h&&(o=i.length),p&&(f=a.length));var v=l.newContainer(e,"grid"),m=k("rows",o),y=k("columns",f);if(m*y>1){if(!d&&!p&&!h)"independent"===k("pattern")&&(d=!0);v._hasSubplotGrid=d;var x,b,_="top to bottom"===k("roworder"),w=d?.2:.1,T=d?.3:.1;g&&e._splomGridDflt&&(x=e._splomGridDflt.xside,b=e._splomGridDflt.yside),v._domains={x:u("x",k,w,x,y),y:u("y",k,T,b,m,_)}}else delete e.grid}function k(t,e){return n.coerce(r,v,s,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=t.grid||{},p=e._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(g);var b=1;for(n=0;n<g;n++){var _=s[n]=new Array(v),w=x[n]||[];for(a=0;a<v;a++)if(m?(l=1===b?"xy":"x"+b+"y"+b,b++):l=w[a],_[a]="",-1!==p.cartesian.indexOf(l)){if(u=l.indexOf("y"),i=l.slice(0,u),o=l.slice(u),void 0!==y[i]&&y[i]!==a||void 0!==y[o]&&y[o]!==n)continue;_[a]=l,y[i]=a,y[o]=n}}}else{var T=c(e,d,"x"),k=c(e,d,"y");r.xaxes=f(T,p.xaxis,v,y,"x"),r.yaxes=f(k,p.yaxis,g,y,"y")}var M=r._anchors={},A="top to bottom"===r.roworder;for(var L in y){var S,C,O,D=L.charAt(0),z=r[D+"side"];if(z.length<8)M[L]="free";else if("x"===D){if("t"===z.charAt(0)===A?(S=0,C=1,O=g):(S=g-1,C=-1,O=-1),h){var P=y[L];for(n=S;n!==O;n+=C)if((l=s[n][P])&&(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"===z.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":233,"../../lib/regex":249,"../../plot_api/plot_template":268,"../../plots/cartesian/constants":285,"../../plots/domain":306}],150:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants"),a=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=a("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":208,"../../plot_api/plot_template":268,"../../plots/cartesian/constants":285}],151:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,i){e=e||{};var o="log"===r&&"linear"===e.type,l="linear"===r&&"log"===e.type;if(o||l)for(var s,c,u=t._fullLayout.images,f=e._id.charAt(0),d=0;d<u.length;d++)if(c="images["+d+"].",(s=u[d])[f+"ref"]===e._id){var p=s[f],h=s["size"+f],g=null,v=null;if(o){g=a(p,e.range);var m=h/Math.pow(10,g)/2;v=2*Math.log(m+Math.sqrt(1+m*m))/Math.LN10}else v=(g=Math.pow(10,p))*(Math.pow(10,h/2)-Math.pow(10,-h/2));n(g)?n(v)||(v=null):(g=null,v=null),i(c+f,g),i(c+"size"+f,v)}}},{"../../lib/to_log_range":257,"fast-isnumeric":23}],152:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("./attributes");function l(t,e,r){function i(r,a){return n.coerce(t,e,o,r,a)}var l=i("source");if(!i("visible",!!l))return e;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var s={_fullLayout:r},c=["x","y"],u=0;u<2;u++){var f=c[u],d=a.coerceRef(t,e,s,f,"paper",void 0);if("paper"!==d)a.getFromId(s,d)._imgIndices.push(e._index);a.coercePosition(e,s,i,d,f,0)}return e}e.exports=function(t,e){i(t,e,{name:"images",handleItemDefaults:l})}},{"../../lib":233,"../../plots/array_container_defaults":274,"../../plots/cartesian/axes":279,"./attributes":150}],153:[function(t,e,r){"use strict";var n=t("d3"),a=t("../drawing"),i=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/axis_ids"),l=t("../../constants/xmlns_namespaces");e.exports=function(t){var e,r,s=t._fullLayout,c=[],u={},f=[];for(r=0;r<s.images.length;r++){var d=s.images[r];if(d.visible)if("below"===d.layer&&"paper"!==d.xref&&"paper"!==d.yref){e=o.ref2id(d.xref)+o.ref2id(d.yref);var p=s._plots[e];if(!p){f.push(d);continue}p.mainplot&&(e=p.mainplot.id),u[e]||(u[e]=[]),u[e].push(d)}else"above"===d.layer?c.push(d):f.push(d)}var h={left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},g={top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}};function v(e){var r=n.select(this);if(this._imgSrc!==e.source)if(r.attr("xmlns",l.svg),e.source&&"data:"===e.source.slice(0,5))r.attr("xlink:href",e.source),this._imgSrc=e.source;else{var a=new Promise(function(t){var n=new Image;function a(){r.remove(),t()}this.img=n,n.setAttribute("crossOrigin","anonymous"),n.onerror=a,n.onload=function(){var e=document.createElement("canvas");e.width=this.width,e.height=this.height,e.getContext("2d").drawImage(this,0,0);var n=e.toDataURL("image/png");r.attr("xlink:href",n),t()},r.on("error",a),n.src=e.source,this._imgSrc=e.source}.bind(this));t._promises.push(a)}}function m(e){var r,o,l=n.select(this),c=i.getFromId(t,e.xref),u=i.getFromId(t,e.yref),f="domain"===i.getRefType(e.xref),d="domain"===i.getRefType(e.yref),p=s._size;r=void 0!==c?"string"==typeof e.xref&&f?c._length*e.sizex:Math.abs(c.l2p(e.sizex)-c.l2p(0)):e.sizex*p.w,o=void 0!==u?"string"==typeof e.yref&&d?u._length*e.sizey:Math.abs(u.l2p(e.sizey)-u.l2p(0)):e.sizey*p.h;var v,m,y=r*h[e.xanchor].offset,x=o*g[e.yanchor].offset,b=h[e.xanchor].sizing+g[e.yanchor].sizing;switch(v=void 0!==c?"string"==typeof e.xref&&f?c._length*e.x+c._offset:c.r2p(e.x)+c._offset:e.x*p.w+p.l,v+=y,m=void 0!==u?"string"==typeof e.yref&&d?u._length*(1-e.y)+u._offset:u.r2p(e.y)+u._offset:p.h-e.y*p.h+p.t,m+=x,e.sizing){case"fill":b+=" slice";break;case"stretch":b="none"}l.attr({x:v,y:m,width:r,height:o,preserveAspectRatio:b,opacity:e.opacity});var _=(c&&"domain"!==i.getRefType(e.xref)?c._id:"")+(u&&"domain"!==i.getRefType(e.yref)?u._id:"");a.setClipUrl(l,_?"clip"+s._uid+_:null,t)}var y=s._imageLowerLayer.selectAll("image").data(f),x=s._imageUpperLayer.selectAll("image").data(c);y.enter().append("image"),x.enter().append("image"),y.exit().remove(),x.exit().remove(),y.each((function(t){v.bind(this)(t),m.bind(this)(t)})),x.each((function(t){v.bind(this)(t),m.bind(this)(t)}));var b=Object.keys(s._plots);for(r=0;r<b.length;r++){e=b[r];var _=s._plots[e];if(_.imagelayer){var w=_.imagelayer.selectAll("image").data(u[e]||[]);w.enter().append("image"),w.exit().remove(),w.each((function(t){v.bind(this)(t),m.bind(this)(t)}))}}}},{"../../constants/xmlns_namespaces":213,"../../plots/cartesian/axes":279,"../../plots/cartesian/axis_ids":282,"../drawing":127,d3:21}],154:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"images",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("images"),draw:t("./draw"),convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":291,"./attributes":150,"./convert_coords":151,"./defaults":152,"./draw":153}],155:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemwidth:{valType:"number",min:30,dflt:30,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":307,"../color/attributes":104}],156:[function(t,e,r){"use strict";e.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}},{}],157:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../plot_api/plot_template"),o=t("./attributes"),l=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){for(var c=t.legend||{},u=0,f=!1,d="normal",p=0;p<r.length;p++){var h=r[p];h.visible&&((h.showlegend||h._dfltShowLegend&&!(h._module&&h._module.attributes&&h._module.attributes.showlegend&&!1===h._module.attributes.showlegend.dflt))&&(u++,h.showlegend&&(f=!0,(n.traceIs(h,"pie-like")||!0===h._input.showlegend)&&u++)),(n.traceIs(h,"bar")&&"stack"===e.barmode||-1!==["tonextx","tonexty"].indexOf(h.fill))&&(d=s.isGrouped({traceorder:d})?"grouped+reversed":"reversed"),void 0!==h.legendgroup&&""!==h.legendgroup&&(d=s.isReversed({traceorder:d})?"reversed+grouped":"grouped"))}var g=a.coerce(t,e,l,"showlegend",f&&u>1);if(!1!==g||c.uirevision){var v=i.newContainer(e,"legend");if(_("uirevision",e.uirevision),!1!==g){_("bgcolor",e.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",e.font);var m,y,x,b=_("orientation");"h"===b?(m=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(m=1.02,y=1,x="auto"),_("traceorder",d),s.isGrouped(e.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemwidth"),_("itemclick"),_("itemdoubleclick"),_("x",m),_("xanchor"),_("y",y),_("yanchor",x),_("valign"),a.noneOrAll(c,v,["x","y"]),_("title.text")&&(_("title.side","h"===b?"left":"top"),a.coerceFont(_,"title.font",e.font))}}function _(t,e){return a.coerce(c,v,o,t,e)}}},{"../../lib":233,"../../plot_api/plot_template":268,"../../plots/layout_attributes":311,"../../registry":326,"./attributes":155,"./helpers":161}],158:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../lib/events"),s=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),d=t("./handle_click"),p=t("./constants"),h=t("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.FROM_BR,y=t("./get_legend_data"),x=t("./style"),b=t("./helpers");function _(t,e,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(t,"plotly_legendclick",s))if(1===n)e._clickTimeout=setTimeout((function(){d(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==l.triggerHandler(t,"plotly_legenddoubleclick",s)&&d(r,t,n)}}function w(t,e,r){var n,i=t.data()[0][0],l=i.trace,s=o.traceIs(l,"pie-like"),u=l.index,d=r._main&&e._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(t,"text","legendtext");g.attr("text-anchor","start").call(c.font,r.font).text(d?T(n,h):n);var v=r.itemwidth+2*p.itemGap;f.positionText(g,v,0),d?g.call(f.makeEditable,{gd:e,text:n}).call(M,t,e,r).on("edit",(function(n){this.text(T(n,h)).call(M,t,e,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",e,s,u)})):M(g,t,e,r)}function T(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function k(t,e){var r,i=e._context.doubleClickDelay,o=1,l=a.ensureSingle(t,"rect","legendtoggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(u.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTime<i?o+=1:(o=1,e._legendMouseDownTime=r)})),l.on("mouseup",(function(){if(!e._dragged&&!e._editing){var r=e._fullLayout.legend;(new Date).getTime()-e._legendMouseDownTime>i&&(o=Math.max(o-1,1)),_(e,r,t,o,n.event)}})))}function M(t,e,r,n){n._main||t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r){var n=t.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void t.remove();var a=t.select("g[class*=math-group]"),i=a.node();r||(r=e._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=t.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);if(n){var x=r.itemwidth+2*p.itemGap;f.positionText(h,x,-y)}else 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)}(e,r,n)}))}function A(t){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function L(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){var r,l=t._fullLayout,f="legend"+l._uid;if(e?(r=e.layer,f+="-hover"):((e=l.legend||{})._main=!0,r=l._infolayer),r){var d;if(t._legendMouseDownTime||(t._legendMouseDownTime=0),e._main){if(!t.calcdata)return;d=l.showlegend&&y(t.calcdata,e)}else{if(!e.entries)return;d=y(e.entries,e)}var h=l.hiddenlabels||[];if(e._main&&(!l.showlegend||!d.length))return r.selectAll(".legend").remove(),l._topdefs.select("#"+f).remove(),i.autoMargin(t,"legend");var g=a.ensureSingle(r,"g","legend",(function(t){e._main&&t.attr("pointer-events","all")})),T=a.ensureSingleById(l._topdefs,"clipPath",f,(function(t){t.append("rect")})),S=a.ensureSingle(g,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));S.call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var C=a.ensureSingle(g,"g","scrollbox"),O=e.title;if(e._titleWidth=0,e._titleHeight=0,O.text){var D=a.ensureSingle(C,"text","legendtitletext");D.attr("text-anchor","start").call(c.font,O.font).text(O.text),M(D,C,t,e)}else C.selectAll(".legendtitletext").remove();var z=a.ensureSingle(g,"rect","scrollbar",(function(t){t.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),P=C.selectAll("g.groups").data(d);P.enter().append("g").attr("class","groups"),P.exit().remove();var E=P.selectAll("g.traces").data(a.identity);E.enter().append("g").attr("class","traces"),E.exit().remove(),E.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==h.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(x,t,e).each((function(){e._main&&n.select(this).call(k,t)})),a.syncOrAsync([i.previousPromises,function(){return function(t,e,r,a){var i=t._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.itemGap,h=a.itemwidth+2*d,g=2*(u+d),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(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(a);if(l)r.each((function(t){var e=t[0].height;c.setTranslate(this,u+_[0],u+_[1]+a._height+e/2+d),a._height+=e,a._width=Math.max(a._width,t[0].width)})),x=h+a._width,a._width+=d+h+f,a._height+=g,s&&(e.each((function(t,e){c.setTranslate(this,0,e*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var w=A(a),T=a.x<0||0===a.x&&"right"===w,k=a.x>1||1===a.x&&"left"===w,M=y||m,S=i.width/2;a._maxWidth=Math.max(T?M&&"left"===w?o.l+o.w:S:k?M&&"right"===w?o.r+o.w:S:o.w,2*h);var C=0,O=0;r.each((function(t){var e=t[0].width+h;C=Math.max(C,e),O+=e})),x=null;var D=0;if(s){var z=0,P=0,E=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,_[0],_[1]+u+d+n/2+e),e+=n,t=Math.max(t,h+r[0].width)})),z=Math.max(z,e);var r=t+d;r+u+P>a._maxWidth&&(D=Math.max(D,P),P=0,E+=z+a.tracegroupgap,z=e),c.setTranslate(this,P,E),P+=r})),a._width=Math.max(D,P)+u,a._height=E+z+g}else{var I=r.size(),R=O+f+(I-1)*d<a._maxWidth,F=0,N=0,B=0,H=0;r.each((function(t){var e=t[0].height,r=h+t[0].width,n=(R?r:C)+d;n+u+N-d>=a._maxWidth&&(D=Math.max(D,H),N=0,B+=F,a._height+=F,F=0),c.setTranslate(this,_[0]+u+N,_[1]+u+B+e/2+d),H=N+r+d,N+=n,F=Math.max(F,e)})),R?(a._width=N+f,a._height=F+g):(a._width=Math.max(D,H)+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=t._context.edits,U=j.legendText||j.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=U?h:x||h+t[0].width;l||(a+=d/2),c.setRect(e,0,-r/2,a,r)}))}(t,P,E,e)},function(){if(!e._main||!function(t){var e=t._fullLayout.legend,r=A(e),n=L(e);return i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*v[r],r:e._width*m[r],b:e._effHeight*m[n],t:e._effHeight*v[n]})}(t)){var u,d,h,y,x=l._size,b=e.borderwidth,w=x.l+x.w*e.x-v[A(e)]*e._width,k=x.t+x.h*(1-e.y)-v[L(e)]*e._effHeight;if(e._main&&l.margin.autoexpand){var M=w,O=k;w=a.constrain(w,0,l.width-e._width),k=a.constrain(k,0,l.height-e._effHeight),w!==M&&a.log("Constrain legend.x to make legend fit inside graph"),k!==O&&a.log("Constrain legend.y to make legend fit inside graph")}if(e._main&&c.setTranslate(g,w,k),z.on(".drag",null),g.on("wheel",null),!e._main||e._height<=e._maxHeight||t._context.staticPlot){var D=e._effHeight;e._main||(D=e._height),S.attr({width:e._width-b,height:D-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),T.select("rect").attr({width:e._width-2*b,height:D-2*b,x:b,y:b}),c.setClipUrl(C,f,t),c.setRect(z,0,0,0,0),delete e._scrollY}else{var P,E,I,R=Math.max(p.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),F=e._effHeight-R-2*p.scrollBarMargin,N=e._height-e._effHeight,B=F/N,H=Math.min(e._scrollY||0,N);S.attr({width:e._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:e._effHeight-b,x:b/2,y:b/2}),T.select("rect").attr({width:e._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:e._effHeight-2*b,x:b,y:b+H}),c.setClipUrl(C,f,t),V(H,R,B),g.on("wheel",(function(){V(H=a.constrain(e._scrollY+n.event.deltaY/F*N,0,N),R,B),0!==H&&H!==N&&n.event.preventDefault()}));var j=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;P="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,I=H})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(E="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,V(H=function(t,e,r){var n=(r-e)/B+t;return a.constrain(n,0,N)}(I,P,E),R,B))}));z.call(j);var U=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(P=t.changedTouches[0].clientY,I=H)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(E=t.changedTouches[0].clientY,V(H=function(t,e,r){var n=(e-r)/B+t;return a.constrain(n,0,N)}(I,P,E),R,B))}));C.call(U)}if(t._context.edits.legendPosition)g.classed("cursor-move",!0),s.init({element:g.node(),gd:t,prepFn:function(){var t=c.getTranslate(g);h=t.x,y=t.y},moveFn:function(t,r){var n=h+t,a=y+r;c.setTranslate(g,n,a),u=s.align(n,0,x.l,x.l+x.w,e.xanchor),d=s.align(a,0,x.t+x.h,x.t,e.yanchor)},doneFn:function(){void 0!==u&&void 0!==d&&o.call("_guiRelayout",t,{"legend.x":u,"legend.y":d})},clickFn:function(e,n){var a=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));a.size()>0&&_(t,g,a,e,n)}})}function V(r,n,a){e._scrollY=t._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(z,e._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),T.select("rect").attr("y",b+r)}}],t)}}},{"../../constants/alignment":207,"../../lib":233,"../../lib/events":226,"../../lib/svg_text_utils":255,"../../plots/plots":313,"../../registry":326,"../color":105,"../dragelement":124,"../drawing":127,"./constants":156,"./get_legend_data":159,"./handle_click":160,"./helpers":161,"./style":163,d3:21}],159:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o={},l=[],s=!1,c={},u=0,f=0,d=e._main;function p(t,r){if(""!==t&&a.isGrouped(e))-1===l.indexOf(t)?(l.push(t),s=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+u;l.push(n),o[n]=[[r]],u++}}for(r=0;r<t.length;r++){var h=t[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(e))for(b=new Array(_),r=0;r<_;r++)x=o[l[r]],b[r]=a.isReversed(e)?x.reverse():x;else{for(b=[new Array(_)],r=0;r<_;r++)x=o[l[r]][0],b[0][a.isReversed(e)?_-r-1:r]=x;_=1}return e._lgroupsLength=_,e._maxNameLength=f,b}},{"../../registry":326,"./helpers":161}],160:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=!0;e.exports=function(t,e,r){var o=e._fullLayout;if(!e._dragged&&!e._editing){var l,s=o.legend.itemclick,c=o.legend.itemdoubleclick;if(1===r&&"toggle"===s&&"toggleothers"===c&&i&&e.data&&e._context.showTips?(n.notifier(n._(e,"Double-click on legend to isolate one trace"),"long"),i=!1):i=!1,1===r?l=s:2===r&&(l=c),l){var u,f,d,p,h,g=o.hiddenlabels?o.hiddenlabels.slice():[],v=t.data()[0][0],m=e._fullData,y=v.trace,x=y.legendgroup,b={},_=[],w=[],T=[];if(a.traceIs(y,"pie-like")){var k=v.label,M=g.indexOf(k);"toggle"===l?-1===M?g.push(k):g.splice(M,1):"toggleothers"===l&&(g=[],e.calcdata[0].forEach((function(t){k!==t.label&&g.push(t.label)})),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===g.length&&-1===M&&(g=[])),a.call("_guiRelayout",e,"hiddenlabels",g)}else{var A,L=x&&x.length,S=[];if(L)for(u=0;u<m.length;u++)(A=m[u]).visible&&A.legendgroup===x&&S.push(u);if("toggle"===l){var C;switch(y.visible){case!0:C="legendonly";break;case!1:C=!1;break;case"legendonly":C=!0}if(L)for(u=0;u<m.length;u++)!1!==m[u].visible&&m[u].legendgroup===x&&N(m[u],C);else N(y,C)}else if("toggleothers"===l){var O,D,z,P,E=!0;for(u=0;u<m.length;u++)if(O=m[u]===y,z=!0!==m[u].showlegend,!(O||z||(D=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:P=!!E||"legendonly",O=m[u]===y,z=!0!==m[u].showlegend&&!m[u].legendgroup,D=O||L&&m[u].legendgroup===x,N(m[u],!(!D&&!z)||P)}}for(u=0;u<w.length;u++)if(d=w[u]){var I=d.constructUpdate(),R=Object.keys(I);for(f=0;f<R.length;f++)p=R[f],(b[p]=b[p]||[])[T[u]]=I[p]}for(h=Object.keys(b),u=0;u<h.length;u++)for(p=h[u],f=0;f<_.length;f++)b[p].hasOwnProperty(f)||(b[p][f]=void 0);a.call("_guiRestyle",e,b,_)}}}function F(t,e,r){var n=_.indexOf(t),a=b[e];return a||(a=b[e]=[]),-1===_.indexOf(t)&&(_.push(t),n=_.length-1),a[n]=r,n}function N(t,e){var r=t._fullInput;if(a.hasTransform(r,"groupby")){var i=w[r.index];if(!i){var o=a.getTransformIndices(r,"groupby"),l=o[o.length-1];i=n.keyedContainer(r,"transforms["+l+"].styles","target","value.visible"),w[r.index]=i}var s=i.get(t._group);void 0===s&&(s=!0),!1!==s&&i.set(t._group,e),T[r.index]=F(r.index,"visible",!1!==r.visible)}else{var c=!1!==r.visible&&e;F(r.index,"visible",c)}}}},{"../../lib":233,"../../registry":326}],161:[function(t,e,r){"use strict";r.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}},{}],162:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"legend",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),style:t("./style")}},{"./attributes":155,"./defaults":157,"./draw":158,"./style":163}],163:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=i.strTranslate,l=t("../drawing"),s=t("../color"),c=t("../colorscale/helpers").extractOpts,u=t("../../traces/scatter/subtypes"),f=t("../../traces/pie/style_one"),d=t("../../traces/pie/helpers").castOption,p=t("./constants");function h(t,e){return(e?"radial":"horizontal")+(t?"":"reversed")}e.exports=function(t,e,r){var g=e._fullLayout;r||(r=g.legend);var v="constant"===r.itemsizing,m=r.itemwidth,y=(m+2*p.itemGap)/2,x=o(y,0),b=function(t,e,r,n){var a;if(t+1)a=t;else{if(!(e&&e.width>0))return 0;a=e.width}return v?n:Math.min(a,r)};function _(t,e,r){var i=t[0].trace,o=i.marker||{},l=o.line||{},c=r?i.visible&&i.type===r:a.traceIs(i,"bar"),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(c?[t]:[]);u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",x),u.exit().remove(),u.each((function(t){var e=n.select(this),r=t[0],a=b(r.mlw,o.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.mc||o.color),a&&s.stroke(e,r.mlc||l.color)}))}function w(t,e,r){var o=t[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(s?[t]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",x),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=b(d(u.width,o.pts),u,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=u.color;var g=i.minExtend(o,{trace:h});f(c,g,h)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var l=r.valign,s=t[0].lineHeight,c=t[0].height;if("middle"!==l&&s&&c){var u={top:1,bottom:-1}[l]*(.5*(s-c+3));a.attr("transform",o(0,u))}else a.attr("transform",null);a.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=a.selectAll("g.legendsymbols").data([t]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,a=t[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["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":o=[["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":o=[["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":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["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(o);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",x).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,o){var u,f=n.select(this),d=c(a),p=d.colorscale,g=d.reversescale;if(p){if(!r){var v=p.length;u=0===o?p[g?v-1:0][1]:1===o?p[g?0:v-1][1]:p[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(m)?m[o]||m[0]:m}f.attr("d",t[0]),u?f.call(s.fill,u):f.call((function(t){if(t.size()){var n="legendfill-"+a.uid;l.gradient(t,e,n,h(g,"radial"===r),p,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var a=t[0].trace[t[0].dir].marker;return t[0].mc=a.color,t[0].mlw=a.line.width,t[0].mlc=a.line.color,_(t,this,"waterfall")}var i=[];e.visible&&r&&(i=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",x).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=b(void 0,a.line,5,2);r.attr("d",t[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(t){_(t,this,"funnel")})).each((function(t){_(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",x),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=b(void 0,r.line,5,2);t.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(t,r.line.color)}else{var c=i.minExtend(r,{marker:{size:v?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(l.pointStyle,c,e)}}))})).each((function(t){w(t,this,"funnelarea")})).each((function(t){w(t,this,"pie")})).each((function(t){var r,a,o=t[0],s=o.trace,f=s.visible&&s.fill&&"none"!==s.fill,d=u.hasLines(s),p=s.contours,g=!1,v=!1,y=c(s),x=y.colorscale,_=y.reversescale;if(p){var w=p.coloring;"lines"===w?g=!0:d="none"===w||"heatmap"===w||p.showlines,"constraint"===p.type?f="="!==p._operation:"fill"!==w&&"heatmap"!==w||(v=!0)}var T=u.hasMarkers(s)||u.hasText(s),k=f||v,M=d||g,A=T||!k?"M5,0":M?"M5,-2":"M5,-3",L=n.select(this),S=L.select(".legendfill").selectAll("path").data(f||v?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",A+"h"+m+"v6h-"+m+"z").call(f?l.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+s.uid;l.gradient(t,e,r,h(_),x,"fill")}}),d||g){var C=b(void 0,s.line,10,5);a=i.minExtend(s,{line:{width:C}}),r=[i.minExtend(o,{trace:a})]}var O=L.select(".legendlines").selectAll("path").data(d||g?[r]:[]);O.enter().append("path").classed("js-line",!0),O.exit().remove(),O.attr("d",A+(g?"l"+m+",0.0001":"h"+m)).call(d?l.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+s.uid;l.lineGroupStyle(t),l.gradient(t,e,r,h(_),x,"stroke")}})})).each((function(t){var r,a,o=t[0],s=o.trace,c=u.hasMarkers(s),f=u.hasText(s),d=u.hasLines(s);function p(t,e,r,n){var a=i.nestedProperty(s,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(o<r[0])return r[0];if(o>r[1])return r[1]}return o}function h(t){return o._distinct&&o.index&&t[o.index]?t[o.index]:t[0]}if(c||f||d){var g={},m={};if(c){g.mc=p("marker.color",h),g.mx=p("marker.symbol",h),g.mo=p("marker.opacity",i.mean,[.2,1]),g.mlc=p("marker.line.color",h),g.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);g.ms=y,m.marker.size=y}d&&(m.line={width:p("line.width",h,[0,10],5)}),f&&(g.tx="Aa",g.tp=p("textposition",h),g.ts=10,g.tc=p("textfont.color",h),g.tf=p("textfont.family",h)),r=[i.minExtend(o,g)],(a=i.minExtend(s,m)).selectedpoints=null,a.texttemplate=null}var b=n.select(this).select("g.legendpoints"),_=b.selectAll("path.scatterpts").data(c?r:[]);_.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",x),_.exit().remove(),_.call(l.pointStyle,a,e),c&&(r[0].mrc=3);var w=b.selectAll("g.pointtext").data(f?r:[]);w.enter().append("g").classed("pointtext",!0).append("text").attr("transform",x),w.exit().remove(),w.selectAll("text").call(l.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",x).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=b(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(s.fill,i.fillcolor),o&&s.stroke(a,i.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",x).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=b(void 0,i.line,5,2);a.style("fill","none").call(l.dashLine,i.line.dash,o),o&&s.stroke(a,i.line.color)}))}))}},{"../../lib":233,"../../registry":326,"../../traces/pie/helpers":439,"../../traces/pie/style_one":445,"../../traces/scatter/subtypes":472,"../color":105,"../colorscale/helpers":116,"../drawing":127,"./constants":156,d3:21}],164:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),l=t("../shapes/draw").eraseActiveShape,s=t("../../lib"),c=s._,u=e.exports={};function f(t,e){var r,a,o=e.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=i.list(t,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a<f.length;a++)if(!(r=f[a]).fixedrange)if(p=r._name,"auto"===s)u[p+".autorange"]=!0;else if("reset"===s){if(void 0===r._rangeInitial)u[p+".autorange"]=!0;else{var m=r._rangeInitial.slice();u[p+".range[0]"]=m[0],u[p+".range[1]"]=m[1]}void 0!==r._showSpikeInitial&&(u[p+".showspikes"]=r._showSpikeInitial,"on"!==d||r._showSpikeInitial||(d="off"))}else{var y=[r.r2l(r.range[0]),r.r2l(r.range[1])],x=[g*y[0]+v*y[1],g*y[1]+v*y[0]];u[p+".range[0]"]=r.l2r(x[0]),u[p+".range[1]"]=r.l2r(x[1])}}else"hovermode"!==l||"x"!==s&&"y"!==s||(s=c._isHoriz?"y":"x",o.setAttribute("data-val",s)),u[l]=s;c._cartesianSpikesEnabled=d,n.call("_guiRelayout",t,u)}function d(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=t._fullLayout._subplots.gl3d||[],l={},s=a.split("."),c=0;c<o.length;c++)l[o[c]+"."+s[1]]=i;var u="pan"===i?i:"zoom";l.dragmode=u,n.call("_guiRelayout",t,l)}function p(t,e){for(var r=e.currentTarget.getAttribute("data-attr"),a="resetLastSave"===r,i="resetDefault"===r,o=t._fullLayout,l=o._subplots.gl3d||[],s={},c=0;c<l.length;c++){var u,f=l[c],d=f+".camera",p=f+".aspectratio",h=f+".aspectmode",g=o[f]._scene;a?(s[d+".up"]=g.viewInitial.up,s[d+".eye"]=g.viewInitial.eye,s[d+".center"]=g.viewInitial.center,u=!0):i&&(s[d+".up"]=null,s[d+".eye"]=null,s[d+".center"]=null,u=!0),u&&(s[p+".x"]=g.viewInitial.aspectratio.x,s[p+".y"]=g.viewInitial.aspectratio.y,s[p+".z"]=g.viewInitial.aspectratio.z,s[h]=g.viewInitial.aspectmode)}n.call("_guiRelayout",t,s)}function h(t,e){var r=e.currentTarget,n=r._previousVal,a=t._fullLayout,i=a._subplots.gl3d||[],o=["xaxis","yaxis","zaxis"],l={},s={};if(n)s=n,r._previousVal=null;else{for(var c=0;c<i.length;c++){var u=i[c],f=a[u],d=u+".hovermode";l[d]=f.hovermode,s[d]=!1;for(var p=0;p<3;p++){var h=o[p],g=u+"."+h+".showspikes";s[g]=!1,l[g]=f[h].showspikes}}r._previousVal=l}return s}function g(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=t._fullLayout,l=o._subplots.geo||[],s=0;s<l.length;s++){var c=l[s],u=o[c];if("zoom"===a){var f=u.projection.scale,d="in"===i?2*f:.5*f;n.call("_guiRelayout",t,c+".projection.scale",d)}}"reset"===a&&x(t,"geo")}function v(t){var e=t._fullLayout;return!e.hovermode&&(e._has("cartesian")?e._isHoriz?"y":"x":"closest")}function m(t){var e=v(t);n.call("_guiRelayout",t,"hovermode",e)}function y(t,e){for(var r=e.currentTarget.getAttribute("data-val"),a=t._fullLayout,i=a._subplots.mapbox||[],o={},l=0;l<i.length;l++){var s=i[l],c=a[s].zoom,u="in"===r?1.05*c:c/1.05;o[s+".zoom"]=u}n.call("_guiRelayout",t,o)}function x(t,e){for(var r=t._fullLayout,a=r._subplots[e]||[],i={},o=0;o<a.length;o++)for(var l=a[o],s=r[l]._subplot.viewInitial,c=Object.keys(s),u=0;u<c.length;u++){var f=c[u];i[l+"."+f]=s[f]}n.call("_guiRelayout",t,i)}u.toImage={name:"toImage",title:function(t){var e=(t._context.toImageButtonOptions||{}).format||"png";return c(t,"png"===e?"Download plot as a png":"Download plot")},icon:o.camera,click:function(t){var e=t._context.toImageButtonOptions,r={format:e.format||"png"};s.notifier(c(t,"Taking snapshot - this may take a few seconds"),"long"),"svg"!==r.format&&s.isIE()&&(s.notifier(c(t,"IE only supports svg. Changing format to svg."),"long"),r.format="svg"),["filename","width","height","scale"].forEach((function(t){t in e&&(r[t]=e[t])})),n.call("downloadImage",t,r).then((function(e){s.notifier(c(t,"Snapshot succeeded")+" - "+e,"long")})).catch((function(){s.notifier(c(t,"Sorry, there was a problem downloading your snapshot!"),"long")}))}},u.sendDataToCloud={name:"sendDataToCloud",title:function(t){return c(t,"Edit in Chart Studio")},icon:o.disk,click:function(t){a.sendDataToCloud(t)}},u.editInChartStudio={name:"editInChartStudio",title:function(t){return c(t,"Edit in Chart Studio")},icon:o.pencil,click:function(t){a.sendDataToCloud(t)}},u.zoom2d={name:"zoom2d",title:function(t){return c(t,"Zoom")},attr:"dragmode",val:"zoom",icon:o.zoombox,click:f},u.pan2d={name:"pan2d",title:function(t){return c(t,"Pan")},attr:"dragmode",val:"pan",icon:o.pan,click:f},u.select2d={name:"select2d",title:function(t){return c(t,"Box Select")},attr:"dragmode",val:"select",icon:o.selectbox,click:f},u.lasso2d={name:"lasso2d",title:function(t){return c(t,"Lasso Select")},attr:"dragmode",val:"lasso",icon:o.lasso,click:f},u.drawclosedpath={name:"drawclosedpath",title:function(t){return c(t,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:o.drawclosedpath,click:f},u.drawopenpath={name:"drawopenpath",title:function(t){return c(t,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:o.drawopenpath,click:f},u.drawline={name:"drawline",title:function(t){return c(t,"Draw line")},attr:"dragmode",val:"drawline",icon:o.drawline,click:f},u.drawrect={name:"drawrect",title:function(t){return c(t,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:o.drawrect,click:f},u.drawcircle={name:"drawcircle",title:function(t){return c(t,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:o.drawcircle,click:f},u.eraseshape={name:"eraseshape",title:function(t){return c(t,"Erase active shape")},icon:o.eraseshape,click:l},u.zoomIn2d={name:"zoomIn2d",title:function(t){return c(t,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:f},u.zoomOut2d={name:"zoomOut2d",title:function(t){return c(t,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:f},u.autoScale2d={name:"autoScale2d",title:function(t){return c(t,"Autoscale")},attr:"zoom",val:"auto",icon:o.autoscale,click:f},u.resetScale2d={name:"resetScale2d",title:function(t){return c(t,"Reset axes")},attr:"zoom",val:"reset",icon:o.home,click:f},u.hoverClosestCartesian={name:"hoverClosestCartesian",title:function(t){return c(t,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:o.tooltip_basic,gravity:"ne",click:f},u.hoverCompareCartesian={name:"hoverCompareCartesian",title:function(t){return c(t,"Compare data on hover")},attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:o.tooltip_compare,gravity:"ne",click:f},u.zoom3d={name:"zoom3d",title:function(t){return c(t,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:o.zoombox,click:d},u.pan3d={name:"pan3d",title:function(t){return c(t,"Pan")},attr:"scene.dragmode",val:"pan",icon:o.pan,click:d},u.orbitRotation={name:"orbitRotation",title:function(t){return c(t,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:o["3d_rotate"],click:d},u.tableRotation={name:"tableRotation",title:function(t){return c(t,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:o["z-axis"],click:d},u.resetCameraDefault3d={name:"resetCameraDefault3d",title:function(t){return c(t,"Reset camera to default")},attr:"resetDefault",icon:o.home,click:p},u.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:function(t){return c(t,"Reset camera to last save")},attr:"resetLastSave",icon:o.movie,click:p},u.hoverClosest3d={name:"hoverClosest3d",title:function(t){return c(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:function(t,e){var r=h(t,e);n.call("_guiRelayout",t,r)}},u.zoomInGeo={name:"zoomInGeo",title:function(t){return c(t,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:g},u.zoomOutGeo={name:"zoomOutGeo",title:function(t){return c(t,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:g},u.resetGeo={name:"resetGeo",title:function(t){return c(t,"Reset")},attr:"reset",val:null,icon:o.autoscale,click:g},u.hoverClosestGeo={name:"hoverClosestGeo",title:function(t){return c(t,"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(t){return c(t,"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(t){return c(t,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:o.tooltip_basic,gravity:"ne",click:m},u.resetViewSankey={name:"resetSankeyGroup",title:function(t){return c(t,"Reset view")},icon:o.home,click:function(t){for(var e={"node.groups":[],"node.x":[],"node.y":[]},r=0;r<t._fullData.length;r++){var a=t._fullData[r]._viewInitial;e["node.groups"].push(a.node.groups.slice()),e["node.x"].push(a.node.x.slice()),e["node.y"].push(a.node.y.slice())}n.call("restyle",t,e)}},u.toggleHover={name:"toggleHover",title:function(t){return c(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:function(t,e){var r=h(t,e);r.hovermode=v(t),n.call("_guiRelayout",t,r)}},u.resetViews={name:"resetViews",title:function(t){return c(t,"Reset views")},icon:o.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),f(t,e),r.setAttribute("data-attr","resetLastSave"),p(t,e),x(t,"geo"),x(t,"mapbox")}},u.toggleSpikelines={name:"toggleSpikelines",title:function(t){return c(t,"Toggle Spike Lines")},icon:o.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout,r=e._cartesianSpikesEnabled;e._cartesianSpikesEnabled="on"===r?"off":"on",n.call("_guiRelayout",t,function(t){for(var e="on"===t._fullLayout._cartesianSpikesEnabled,r=i.list(t,null,!0),n={},a=0;a<r.length;a++){var o=r[a];n[o._name+".showspikes"]=!!e||o._showSpikeInitial}return n}(t))}},u.resetViewMapbox={name:"resetViewMapbox",title:function(t){return c(t,"Reset view")},attr:"reset",icon:o.home,click:function(t){x(t,"mapbox")}},u.zoomInMapbox={name:"zoomInMapbox",title:function(t){return c(t,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:y},u.zoomOutMapbox={name:"zoomOutMapbox",title:function(t){return c(t,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:y}},{"../../fonts/ploticon":216,"../../lib":233,"../../plots/cartesian/axis_ids":282,"../../plots/plots":313,"../../registry":326,"../shapes/draw":186}],165:[function(t,e,r){"use strict";r.manage=t("./manage")},{"./manage":166}],166:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids"),a=t("../../traces/scatter/subtypes"),i=t("../../registry"),o=t("../fx/helpers").isUnifiedHover,l=t("./modebar"),s=t("./buttons");e.exports=function(t){var e=t._fullLayout,r=t._context,u=e._modeBar;if(r.displayModeBar||r.watermark){if(!Array.isArray(r.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(r.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var f,d=r.modeBarButtons;f=Array.isArray(d)&&d.length?function(t){for(var e=0;e<t.length;e++)for(var r=t[e],n=0;n<r.length;n++){var a=r[n];if("string"==typeof a){if(void 0===s[a])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[e][n]=s[a]}}return t}(d):!r.displayModeBar&&r.watermark?[]:function(t){var e=t._fullLayout,r=t._fullData,l=t._context,u=l.modeBarButtonsToRemove,f=l.modeBarButtonsToAdd,d=e._has("cartesian"),p=e._has("gl3d"),h=e._has("geo"),g=e._has("pie"),v=e._has("funnelarea"),m=e._has("gl2d"),y=e._has("ternary"),x=e._has("mapbox"),b=e._has("polar"),_=e._has("sankey"),w=function(t){for(var e=n.list({_fullLayout:t},null,!0),r=0;r<e.length;r++)if(!e[r].fixedrange)return!1;return!0}(e),T=o(e.hovermode),k=[];function M(t){if(t.length){for(var e=[],r=0;r<t.length;r++){var n=t[r];-1===u.indexOf(n)&&e.push(s[n])}k.push(e)}}var A=["toImage"];l.showEditInChartStudio?A.push("editInChartStudio"):l.showSendToCloud&&A.push("sendDataToCloud");M(A);var L=[],S=[],C=[],O=[];(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(t){for(var e=0;e<t.length;e++)if(!i.traceIs(t[e],"noHover"))return!1;return!0}(r)||T)&&(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(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&(i.traceIs(n,"scatter-like")?(a.hasMarkers(n)||a.hasText(n))&&(e=!0):i.traceIs(n,"box-violin")&&"all"!==n.boxpoints&&"all"!==n.points||(e=!0))}return e})(r)&&O.push("select2d","lasso2d");if(Array.isArray(f)){for(var D=[],z=0;z<f.length;z++){var P=f[z];"string"==typeof P?-1!==c.indexOf(P)&&(e._has("mapbox")||e._has("cartesian"))&&O.push(P):D.push(P)}f=D}return M(O),M(L.concat(C)),M(S),function(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}(k,f)}(t),u?u.update(t,f):e._modeBar=l(t,f)}else u&&(u.destroy(),delete e._modeBar)};var c=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"]},{"../../plots/cartesian/axis_ids":282,"../../registry":326,"../../traces/scatter/subtypes":472,"../fx/helpers":141,"./buttons":164,"./modebar":167}],167:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../fonts/ploticon"),l=new DOMParser;function s(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}var c=s.prototype;c.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context,n=this.graphInfo._fullLayout,a="modebar-"+n._uid;this.element.setAttribute("id",a),this._uid=a,this.element.className="modebar","hover"===r.displayModeBar&&(this.element.className+=" modebar--hover ease-bg"),"v"===n.modebar.orientation&&(this.element.className+=" vertical",e=e.reverse());var o=n.modebar,l="hover"===r.displayModeBar?".js-plotly-plot .plotly:hover ":"";i.deleteRelatedStyleRule(a),i.addRelatedStyleRule(a,l+"#"+a+" .modebar-group","background-color: "+o.bgcolor),i.addRelatedStyleRule(a,"#"+a+" .modebar-btn .icon path","fill: "+o.color),i.addRelatedStyleRule(a,"#"+a+" .modebar-btn:hover .icon path","fill: "+o.activecolor),i.addRelatedStyleRule(a,"#"+a+" .modebar-btn.active .icon path","fill: "+o.activecolor);var s=!this.hasButtons(e),c=this.hasLogo!==r.displaylogo,u=this.locale!==r.locale;if(this.locale=r.locale,(s||c||u)&&(this.removeAllButtons(),this.updateButtons(e),r.watermark||r.displaylogo)){var f=this.getLogo();r.watermark&&(f.className=f.className+" watermark"),"v"===n.modebar.orientation?this.element.insertBefore(f,this.element.childNodes[0]):this.element.appendChild(f),this.hasLogo=!0}this.updateActiveButton()},c.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach((function(t){var r=e.createGroup();t.forEach((function(t){var n=t.name;if(!n)throw new Error("must provide button 'name' in button config");if(-1!==e.buttonsNames.indexOf(n))throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var a=e.createButton(t);e.buttonElements.push(a),r.appendChild(a)})),e.element.appendChild(r)}))},c.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t},c.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var a=t.title;void 0===a?a=t.name:"function"==typeof a&&(a=a(this.graphInfo)),(a||0===a)&&r.setAttribute("data-title",a),void 0!==t.attr&&r.setAttribute("data-attr",t.attr);var i=t.val;if(void 0!==i&&("function"==typeof i&&(i=i(this.graphInfo)),r.setAttribute("data-val",i)),"function"!=typeof t.click)throw new Error("must provide button 'click' function in button config");r.addEventListener("click",(function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)})),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&n.select(r).classed("active",!0);var l=t.icon;return"function"==typeof l?r.appendChild(l()):r.appendChild(this.createIcon(l||o.question)),r.setAttribute("data-gravity",t.gravity||"n"),r},c.createIcon=function(t){var e,r=a(t.height)?Number(t.height):t.ascent-t.descent,n="http://www.w3.org/2000/svg";if(t.path){(e=document.createElementNS(n,"svg")).setAttribute("viewBox",[0,0,t.width,r].join(" ")),e.setAttribute("class","icon");var i=document.createElementNS(n,"path");i.setAttribute("d",t.path),t.transform?i.setAttribute("transform",t.transform):void 0!==t.ascent&&i.setAttribute("transform","matrix(1 0 0 -1 0 "+t.ascent+")"),e.appendChild(i)}t.svg&&(e=l.parseFromString(t.svg,"application/xml").childNodes[0]);return e.setAttribute("height","1em"),e.setAttribute("width","1em"),e},c.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach((function(t){var a=t.getAttribute("data-val")||!0,o=t.getAttribute("data-attr"),l="true"===t.getAttribute("data-toggle"),s=n.select(t);if(l)o===r&&s.classed("active",!s.classed("active"));else{var c=null===o?o:i.nestedProperty(e,o).get();s.classed("active",c===a)}}))},c.hasButtons=function(t){var e=this.buttons;if(!e)return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;n++)if(t[r][n].name!==e[r][n].name)return!1}return!0},c.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plotly.com/",e.target="_blank",e.setAttribute("data-title",i._(this.graphInfo,"Produced with Plotly")),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(o.newplotlylogo)),t.appendChild(e),t},c.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},c.destroy=function(){i.removeElement(this.container.querySelector(".modebar")),i.deleteRelatedStyleRule(this._uid)},e.exports=function(t,e){var r=t._fullLayout,a=new s({graphInfo:t,container:r._modebardiv.node(),buttons:e});return r._privateplot&&n.select(a.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),a}},{"../../fonts/ploticon":216,"../../lib":233,d3:21,"fast-isnumeric":23}],168:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=(0,t("../../plot_api/plot_template").templatedArray)("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});e.exports={visible:{valType:"boolean",editType:"plot"},buttons:i,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:n({editType:"plot"}),bgcolor:{valType:"color",dflt:a.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}},{"../../plot_api/plot_template":268,"../../plots/font_attributes":307,"../color/attributes":104}],169:[function(t,e,r){"use strict";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],170:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("../../plot_api/plot_template"),o=t("../../plots/array_container_defaults"),l=t("./attributes"),s=t("./constants");function c(t,e,r,a){var i=a.calendar;function o(r,a){return n.coerce(t,e,l.buttons,r,a)}if(o("visible")){var s=o("step");"all"!==s&&(!i||"gregorian"===i||"month"!==s&&"year"!==s?o("stepmode"):e.stepmode="backward",o("count")),o("label")}}e.exports=function(t,e,r,u,f){var d=t.rangeselector||{},p=i.newContainer(e,"rangeselector");function h(t,e){return n.coerce(d,p,l,t,e)}if(h("visible",o(d,p,{name:"buttons",handleItemDefaults:c,calendar:f}).length>0)){var g=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),a=0,i=0;i<n.length;i++){var o=e[n[i]].domain;o&&(a=Math.max(o[1],a))}return[t.domain[0],a+s.yPad]}(e,r,u);h("x",g[0]),h("y",g[1]),n.noneOrAll(t,e,["x","y"]),h("xanchor"),h("yanchor"),n.coerceFont(h,"font",r.font);var v=h("bgcolor");h("activecolor",a.contrast(v,s.lightAmount,s.darkAmount)),h("bordercolor"),h("borderwidth")}}},{"../../lib":233,"../../plot_api/plot_template":268,"../../plots/array_container_defaults":274,"../color":105,"./attributes":168,"./constants":169}],171:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../color"),l=t("../drawing"),s=t("../../lib"),c=s.strTranslate,u=t("../../lib/svg_text_utils"),f=t("../../plots/cartesian/axis_ids"),d=t("../../constants/alignment"),p=d.LINE_SPACING,h=d.FROM_TL,g=d.FROM_BR,v=t("./constants"),m=t("./get_update_object");function y(t){return t._id}function x(t,e,r){var n=s.ensureSingle(t,"rect","selector-rect",(function(t){t.attr("shape-rendering","crispEdges")}));n.attr({rx:v.rx,ry:v.ry}),n.call(o.stroke,e.bordercolor).call(o.fill,function(t,e){return e._isActive||e._isHovered?t.activecolor:t.bgcolor}(e,r)).style("stroke-width",e.borderwidth+"px")}function b(t,e,r,n){s.ensureSingle(t,"text","selector-text",(function(t){t.attr("text-anchor","middle")})).call(l.font,e.font).text(function(t,e){if(t.label)return e?s.templateString(t.label,e):t.label;return"all"===t.step?"all":t.count+t.step.charAt(0)}(r,n._fullLayout._meta)).call((function(t){u.convertToTspans(t,n)}))}e.exports=function(t){var e=t._fullLayout._infolayer.selectAll(".rangeselector").data(function(t){for(var e=f.list(t,"x",!0),r=[],n=0;n<e.length;n++){var a=e[n];a.rangeselector&&a.rangeselector.visible&&r.push(a)}return r}(t),y);e.enter().append("g").classed("rangeselector",!0),e.exit().remove(),e.style({cursor:"pointer","pointer-events":"all"}),e.each((function(e){var r=n.select(this),o=e,f=o.rangeselector,d=r.selectAll("g.button").data(s.filterVisible(f.buttons));d.enter().append("g").classed("button",!0),d.exit().remove(),d.each((function(e){var r=n.select(this),i=m(o,e);e._isActive=function(t,e,r){if("all"===e.step)return!0===t.autorange;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}(o,e,i),r.call(x,f,e),r.call(b,f,e,t),r.on("click",(function(){t._dragged||a.call("_guiRelayout",t,i)})),r.on("mouseover",(function(){e._isHovered=!0,r.call(x,f,e)})),r.on("mouseout",(function(){e._isHovered=!1,r.call(x,f,e)}))})),function(t,e,r,a,o){var f=0,d=0,m=r.borderwidth;e.each((function(){var t=n.select(this).select(".selector-text"),e=r.font.size*p,a=Math.max(e*u.lineCount(t),16)+3;d=Math.max(d,a)})),e.each((function(){var t=n.select(this),e=t.select(".selector-rect"),a=t.select(".selector-text"),i=a.node()&&l.bBox(a.node()).width,o=r.font.size*p,s=u.lineCount(a),h=Math.max(i+10,v.minButtonWidth);t.attr("transform",c(m+f,m)),e.attr({x:0,y:0,width:h,height:d}),u.positionText(a,h/2,d/2-(s-1)*o/2+3),f+=h+5}));var y=t._fullLayout._size,x=y.l+y.w*r.x,b=y.t+y.h*(1-r.y),_="left";s.isRightAnchor(r)&&(x-=f,_="right");s.isCenterAnchor(r)&&(x-=f/2,_="center");var w="top";s.isBottomAnchor(r)&&(b-=d,w="bottom");s.isMiddleAnchor(r)&&(b-=d/2,w="middle");f=Math.ceil(f),d=Math.ceil(d),x=Math.round(x),b=Math.round(b),i.autoMargin(t,a+"-range-selector",{x:r.x,y:r.y,l:f*h[_],r:f*g[_],b:d*g[w],t:d*h[w]}),o.attr("transform",c(x,b))}(t,d,f,o._name,r)}))}},{"../../constants/alignment":207,"../../lib":233,"../../lib/svg_text_utils":255,"../../plots/cartesian/axis_ids":282,"../../plots/plots":313,"../../registry":326,"../color":105,"../drawing":127,"./constants":169,"./get_update_object":172,d3:21}],172:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e){var r=t._name,a={};if("all"===e.step)a[r+".autorange"]=!0;else{var i=function(t,e){var r,a=t.range,i=new Date(t.r2l(a[1])),o=e.step,l=e.count;switch(e.stepmode){case"backward":r=t.l2r(+n.time[o].utc.offset(i,-l));break;case"todate":var s=n.time[o].utc.offset(i,-l);r=t.l2r(+n.time[o].utc.ceil(s))}var c=a[1];return[r,c]}(t,e);a[r+".range[0]"]=i[0],a[r+".range[1]"]=i[1]}return a}},{d3:21}],173:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":168,"./defaults":170,"./draw":171}],174:[function(t,e,r){"use strict";var n=t("../color/attributes");e.exports={bgcolor:{valType:"color",dflt:n.background,editType:"plot"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}},{"../color/attributes":104}],175:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids").list,a=t("../../plots/cartesian/autorange").getAutoRange,i=t("./constants");e.exports=function(t){for(var e=n(t,"x",!0),r=0;r<e.length;r++){var o=e[r],l=o[i.name];l&&l.visible&&l.autorange&&(l._input.autorange=!0,l._input.range=l.range=a(t,o))}}},{"../../plots/cartesian/autorange":278,"../../plots/cartesian/axis_ids":282,"./constants":176}],176:[function(t,e,r){"use strict";e.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},{}],177:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plot_api/plot_template"),i=t("../../plots/cartesian/axis_ids"),o=t("./attributes"),l=t("./oppaxis_attributes");e.exports=function(t,e,r){var s=t[r],c=e[r];if(s.rangeslider||e._requestRangeslider[c._id]){n.isPlainObject(s.rangeslider)||(s.rangeslider={});var u,f,d=s.rangeslider,p=a.newContainer(c,"rangeslider");if(_("visible")){_("bgcolor",e.plot_bgcolor),_("bordercolor"),_("borderwidth"),_("thickness"),_("autorange",!c.isValidRange(d.range)),_("range");var h=e._subplots;if(h)for(var g=h.cartesian.filter((function(t){return t.substr(0,t.indexOf("y"))===i.name2id(r)})).map((function(t){return t.substr(t.indexOf("y"),t.length)})),v=n.simpleMap(g,i.id2name),m=0;m<v.length;m++){var y=v[m];u=d[y]||{},f=a.newContainer(p,y,"yaxis");var x,b=e[y];u.range&&b.isValidRange(u.range)&&(x="fixed"),"match"!==w("rangemode",x)&&w("range",b.range.slice())}p._input=d}}function _(t,e){return n.coerce(d,p,o,t,e)}function w(t,e){return n.coerce(u,f,l,t,e)}}},{"../../lib":233,"../../plot_api/plot_template":268,"../../plots/cartesian/axis_ids":282,"./attributes":174,"./oppaxis_attributes":181}],178:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../../lib"),l=o.strTranslate,s=t("../drawing"),c=t("../color"),u=t("../titles"),f=t("../../plots/cartesian"),d=t("../../plots/cartesian/axis_ids"),p=t("../dragelement"),h=t("../../lib/setcursor"),g=t("./constants");function v(t,e,r,n){var a=o.ensureSingle(t,"rect",g.bgClassName,(function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})})),i=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,c=-n._offsetShift,u=s.crispRound(e,n.borderwidth);a.attr({width:n._width+i,height:n._height+i,transform:l(c,c),fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":u})}function m(t,e,r,n){var a=e._fullLayout;o.ensureSingleById(a._topdefs,"clipPath",n._clipId,(function(t){t.append("rect").attr({x:0,y:0})})).select("rect").attr({width:n._width,height:n._height})}function y(t,e,r,a){var l,c=e.calcdata,u=t.selectAll("g."+g.rangePlotClassName).data(r._subplotsWith,o.identity);u.enter().append("g").attr("class",(function(t){return g.rangePlotClassName+" "+t})).call(s.setClipUrl,a._clipId,e),u.order(),u.exit().remove(),u.each((function(t,o){var s=n.select(this),u=0===o,p=d.getFromId(e,t,"y"),h=p._name,g=a[h],v={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:a.range.slice(),calendar:r.calendar},width:a._width,height:a._height,margin:{t:0,b:0,l:0,r:0}},_context:e._context};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:t,plotgroup:s,xaxis:m,yaxis:y,isRangePlot:!0};u?l=x:(x.mainplot="xy",x.mainplotinfo=l),f.rangePlot(e,x,function(t,e){for(var r=[],n=0;n<t.length;n++){var a=t[n],i=a[0].trace;i.xaxis+i.yaxis===e&&r.push(a)}return r}(c,t))}))}function x(t,e,r,n,a){(o.ensureSingle(t,"rect",g.maskMinClassName,(function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(c.fill,g.maskColor),o.ensureSingle(t,"rect",g.maskMaxClassName,(function(t){t.attr({y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(c.fill,g.maskColor),"match"!==a.rangemode)&&(o.ensureSingle(t,"rect",g.maskMinOppAxisClassName,(function(t){t.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).call(c.fill,g.maskOppAxisColor),o.ensureSingle(t,"rect",g.maskMaxOppAxisClassName,(function(t){t.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).style("border-top",g.maskOppBorder).call(c.fill,g.maskOppAxisColor))}function b(t,e,r,n){e._context.staticPlot||o.ensureSingle(t,"rect",g.slideBoxClassName,(function(t){t.attr({y:0,cursor:g.slideBoxCursor,"shape-rendering":"crispEdges"})})).attr({height:n._height,fill:g.slideBoxFill})}function _(t,e,r,n){var a=o.ensureSingle(t,"g",g.grabberMinClassName),i=o.ensureSingle(t,"g",g.grabberMaxClassName),l={x:0,width:g.handleWidth,rx:g.handleRadius,fill:c.background,stroke:c.defaultLine,"stroke-width":g.handleStrokeWidth,"shape-rendering":"crispEdges"},s={y:Math.round(n._height/4),height:Math.round(n._height/2)};o.ensureSingle(a,"rect",g.handleMinClassName,(function(t){t.attr(l)})).attr(s),o.ensureSingle(i,"rect",g.handleMaxClassName,(function(t){t.attr(l)})).attr(s);var u={width:g.grabAreaWidth,x:0,y:0,fill:g.grabAreaFill,cursor:e._context.staticPlot?void 0:g.grabAreaCursor};o.ensureSingle(a,"rect",g.grabAreaMinClassName,(function(t){t.attr(u)})).attr("height",n._height),o.ensureSingle(i,"rect",g.grabAreaMaxClassName,(function(t){t.attr(u)})).attr("height",n._height)}e.exports=function(t){for(var e=t._fullLayout,r=e._rangeSliderData,i=0;i<r.length;i++){var s=r[i][g.name];s._clipId=s._id+"-"+e._uid}var c=e._infolayer.selectAll("g."+g.containerClassName).data(r,(function(t){return t._name}));c.exit().each((function(t){var r=t[g.name];e._topdefs.select("#"+r._clipId).remove()})).remove(),0!==r.length&&(c.enter().append("g").classed(g.containerClassName,!0).attr("pointer-events","all"),c.each((function(r){var i=n.select(this),s=r[g.name],c=e[d.id2name(r.anchor)],f=s[d.id2name(r.anchor)];if(s.range){var w,T=o.simpleMap(s.range,r.r2l),k=o.simpleMap(r.range,r.r2l);w=k[0]<k[1]?[Math.min(T[0],k[0]),Math.max(T[1],k[1])]:[Math.max(T[0],k[0]),Math.min(T[1],k[1])],s.range=s._input.range=o.simpleMap(w,r.l2r)}r.cleanRange("rangeslider.range");var M=e._size,A=r.domain;s._width=M.w*(A[1]-A[0]);var L=Math.round(M.l+M.w*A[0]),S=Math.round(M.t+M.h*(1-r._counterDomainMin)+("bottom"===r.side?r._depth:0)+s._offsetShift+g.extraPad);i.attr("transform",l(L,S)),s._rl=o.simpleMap(s.range,r.r2l);var C=s._rl[0],O=s._rl[1],D=O-C;if(s.p2d=function(t){return t/s._width*D+C},s.d2p=function(t){return(t-C)/D*s._width},r.rangebreaks){var z=r.locateBreaks(C,O);if(z.length){var P,E,I=0;for(P=0;P<z.length;P++)I+=(E=z[P]).max-E.min;var R=s._width/(O-C-I),F=[-R*C];for(P=0;P<z.length;P++)E=z[P],F.push(F[F.length-1]-R*(E.max-E.min));for(s.d2p=function(t){for(var e=F[0],r=0;r<z.length;r++){var n=z[r];if(t>=n.max)e=F[r+1];else if(t<n.min)break}return e+R*t},P=0;P<z.length;P++)(E=z[P]).pmin=s.d2p(E.min),E.pmax=s.d2p(E.max);s.p2d=function(t){for(var e=F[0],r=0;r<z.length;r++){var n=z[r];if(t>=n.pmax)e=F[r+1];else if(t<n.pmin)break}return(t-e)/R}}}if("match"!==f.rangemode){var N=c.r2l(f.range[0]),B=c.r2l(f.range[1])-N;s.d2pOppAxis=function(t){return(t-N)/B*s._height}}i.call(v,t,r,s).call(m,t,r,s).call(y,t,r,s).call(x,t,r,s,f).call(b,t,r,s).call(_,t,r,s),function(t,e,r,i){if(e._context.staticPlot)return;var l=t.select("rect."+g.slideBoxClassName).node(),s=t.select("rect."+g.grabAreaMinClassName).node(),c=t.select("rect."+g.grabAreaMaxClassName).node();function u(){var u=n.event,f=u.target,d=u.clientX||u.touches[0].clientX,g=d-t.node().getBoundingClientRect().left,v=i.d2p(r._rl[0]),m=i.d2p(r._rl[1]),y=p.coverSlip();function x(t){var u,p,x,b=+(t.clientX||t.touches[0].clientX)-d;switch(f){case l:x="ew-resize",u=v+b,p=m+b;break;case s:x="col-resize",u=v+b,p=m;break;case c:x="col-resize",u=v,p=m+b;break;default:x="ew-resize",u=g,p=g+b}if(p<u){var _=p;p=u,u=_}i._pixelMin=u,i._pixelMax=p,h(n.select(y),x),function(t,e,r,n){function i(t){return r.l2r(o.constrain(t,n._rl[0],n._rl[1]))}var l=i(n.p2d(n._pixelMin)),s=i(n.p2d(n._pixelMax));window.requestAnimationFrame((function(){a.call("_guiRelayout",e,r._name+".range",[l,s])}))}(0,e,r,i)}function b(){y.removeEventListener("mousemove",x),y.removeEventListener("mouseup",b),this.removeEventListener("touchmove",x),this.removeEventListener("touchend",b),o.removeElement(y)}this.addEventListener("touchmove",x),this.addEventListener("touchend",b),y.addEventListener("mousemove",x),y.addEventListener("mouseup",b)}t.on("mousedown",u),t.on("touchstart",u)}(i,t,r,s),function(t,e,r,n,a,i){var s=g.handleWidth/2;function c(t){return o.constrain(t,0,n._width)}function u(t){return o.constrain(t,0,n._height)}function f(t){return o.constrain(t,-s,n._width+s)}var d=c(n.d2p(r._rl[0])),p=c(n.d2p(r._rl[1]));if(t.select("rect."+g.slideBoxClassName).attr("x",d).attr("width",p-d),t.select("rect."+g.maskMinClassName).attr("width",d),t.select("rect."+g.maskMaxClassName).attr("x",p).attr("width",n._width-p),"match"!==i.rangemode){var h=n._height-u(n.d2pOppAxis(a._rl[1])),v=n._height-u(n.d2pOppAxis(a._rl[0]));t.select("rect."+g.maskMinOppAxisClassName).attr("x",d).attr("height",h).attr("width",p-d),t.select("rect."+g.maskMaxOppAxisClassName).attr("x",d).attr("y",v).attr("height",n._height-v).attr("width",p-d),t.select("rect."+g.slideBoxClassName).attr("y",h).attr("height",v-h)}var m=Math.round(f(d-s))-.5,y=Math.round(f(p-s))+.5;t.select("g."+g.grabberMinClassName).attr("transform",l(m,.5)),t.select("g."+g.grabberMaxClassName).attr("transform",l(y,.5))}(i,0,r,s,c,f),"bottom"===r.side&&u.draw(t,r._id+"title",{propContainer:r,propName:r._name+".title",placeholder:e._dfltTitle.x,attributes:{x:r._offset+r._length/2,y:S+s._height+s._offsetShift+10+1.5*r.title.font.size,"text-anchor":"middle"}})})))}},{"../../lib":233,"../../lib/setcursor":253,"../../plots/cartesian":292,"../../plots/cartesian/axis_ids":282,"../../plots/plots":313,"../../registry":326,"../color":105,"../dragelement":124,"../drawing":127,"../titles":200,"./constants":176,d3:21}],179:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids"),a=t("../../lib/svg_text_utils"),i=t("./constants"),o=t("../../constants/alignment").LINE_SPACING,l=i.name;function s(t){var e=t&&t[l];return e&&e.visible}r.isVisible=s,r.makeData=function(t){var e=n.list({_fullLayout:t},"x",!0),r=t.margin,a=[];if(!t._has("gl2d"))for(var i=0;i<e.length;i++){var o=e[i];if(s(o)){a.push(o);var c=o[l];c._id=l+o._id,c._height=(t.height-r.b-r.t)*c.thickness,c._offsetShift=Math.floor(c.borderwidth/2)}}t._rangeSliderData=a},r.autoMarginOpts=function(t,e){var r=t._fullLayout,n=e[l],s=e._id.charAt(0),c=0,u=0;"bottom"===e.side&&(c=e._depth,e.title.text!==r._dfltTitle[s]&&(u=1.5*e.title.font.size+10+n._offsetShift,u+=(e.title.text.match(a.BR_TAG_ALL)||[]).length*e.title.font.size*o));return{x:0,y:e._counterDomainMin,l:0,r:0,t:0,b:n._height+c+Math.max(r.margin.b,u),pad:i.extraPad+2*n._offsetShift}}},{"../../constants/alignment":207,"../../lib/svg_text_utils":255,"../../plots/cartesian/axis_ids":282,"./constants":176}],180:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./oppaxis_attributes"),o=t("./helpers");e.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:n.extendFlat({},a,{yaxis:i})}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:t("./draw"),isVisible:o.isVisible,makeData:o.makeData,autoMarginOpts:o.autoMarginOpts}},{"../../lib":233,"./attributes":174,"./calc_autorange":175,"./defaults":177,"./draw":178,"./helpers":179,"./oppaxis_attributes":181}],181:[function(t,e,r){"use strict";e.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}},{}],182:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),a=t("../../traces/scatter/attributes").line,i=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat,l=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=l("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},a.color,{editType:"arraydraw"}),width:o({},a.width,{editType:"calc+arraydraw"}),dash:o({},i,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":208,"../../lib/extend":227,"../../plot_api/plot_template":268,"../../traces/scatter/attributes":447,"../annotations/attributes":90,"../drawing/attributes":126}],183:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./constants"),o=t("./helpers");function l(t){return c(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function s(t){return c(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function c(t,e,r,a,l,s){var c=t/2,u=s;if("pixel"===e){var f=l?o.extractPathCoords(l,s?i.paramIsY:i.paramIsX):[r,a],d=n.aggNums(Math.max,null,f),p=n.aggNums(Math.min,null,f),h=p<0?Math.abs(p)+c:c,g=d>0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(t,e,r,n,a){var l="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[l(e),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===t.type&&(l=o.decodeDate(l)),s=0;s<h.length;s++)void 0!==(c=a[h[s].charAt(0)].drawn)&&(!(u=h[s].substr(1).match(i.paramRE))||u.length<c||((f=l(u[c]))<d&&(d=f),f>p&&(p=f)));return p>=d?[d,p]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;o<r.length;o++){var c,f,d=r[o];d._extremes={};var p=a.getRefType(d.xref),h=a.getRefType(d.yref);if("paper"!==d.xref&&"domain"!==p){var g="pixel"===d.xsizemode?d.xanchor:d.x0,v="pixel"===d.xsizemode?d.xanchor:d.x1;(f=u(c=a.getFromId(t,d.xref),g,v,d.path,i.paramIsX))&&(d._extremes[c._id]=a.findExtremes(c,f,l(d)))}if("paper"!==d.yref&&"domain"!==h){var m="pixel"===d.ysizemode?d.yanchor:d.y0,y="pixel"===d.ysizemode?d.yanchor:d.y1;(f=u(c=a.getFromId(t,d.yref),m,y,d.path,i.paramIsY))&&(d._extremes[c._id]=a.findExtremes(c,f,s(d)))}}}},{"../../lib":233,"../../plots/cartesian/axes":279,"./constants":184,"./helpers":193}],184:[function(t,e,r){"use strict";e.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}},{}],185:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("./attributes"),l=t("./helpers");function s(t,e,r){function i(r,a){return n.coerce(t,e,o,r,a)}if(i("visible")){var s=i("path"),c=i("type",s?"path":"rect");"path"!==e.type&&delete e.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(t,e,b,m,void 0,"paper");if("range"===a.getRefType(_)?((h=a.getFromId(b,_))._shapeIndices.push(e._index),v=l.rangeToShapePosition(h),g=l.shapePositionToRange(h)):g=v=n.identity,"path"!==c){var w=m+"0",T=m+"1",k=t[w],M=t[T];t[w]=g(t[w],!0),t[T]=g(t[T],!0),"pixel"===x?(i(w,0),i(T,10)):(a.coercePosition(e,b,i,_,w,.25),a.coercePosition(e,b,i,_,T,.75)),e[w]=v(e[w]),e[T]=v(e[T]),t[w]=k,t[T]=M}if("pixel"===x){var A=t[y];t[y]=g(t[y],!0),a.coercePosition(e,b,i,_,y,.25),e[y]=v(e[y]),t[y]=A}}"path"===c?i("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"])}}e.exports=function(t,e){i(t,e,{name:"shapes",handleItemDefaults:s})}},{"../../lib":233,"../../plots/array_container_defaults":274,"../../plots/cartesian/axes":279,"./attributes":182,"./helpers":193}],186:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("./draw_newshape/helpers").readPaths,l=t("./draw_newshape/display_outlines"),s=t("../../plots/cartesian/handle_outline").clearOutlineControllers,c=t("../color"),u=t("../drawing"),f=t("../../plot_api/plot_template").arrayEditor,d=t("../dragelement"),p=t("../../lib/setcursor"),h=t("./constants"),g=t("./helpers");function v(t){var e=t._fullLayout;for(var r in e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var a=0;a<e.shapes.length;a++)e.shapes[a].visible&&x(t,a)}function m(t){return!!t._fullLayout._drawing}function y(t){return!t._context.edits.shapePosition}function x(t,e){t._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+e+'"]').remove();var r=g.makeOptionsAndPlotinfo(t,e),s=r.options,x=r.plotinfo;if(s._input&&!1!==s.visible)if("below"!==s.layer)k(t._fullLayout._shapeUpperLayer);else if("paper"===s.xref||"paper"===s.yref)k(t._fullLayout._shapeLowerLayer);else{if(x._hadPlotinfo)k((x.mainplotinfo||x).shapelayer);else k(t._fullLayout._shapeLowerLayer)}function k(r){var k=_(t,s),M={"data-index":e,"fill-rule":s.fillrule,d:k},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 D="Z"!==k[k.length-1],z=y(t)&&s.editable&&t._fullLayout._activeShapeIndex===e;z&&(L=D?"rgba(0,0,0,0)":t._fullLayout.activeshape.fillcolor,A=t._fullLayout.activeshape.opacity);var P,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,t,s),(z||t._context.edits.shapePosition)&&(P=f(t.layout,"shapes",s)),z){E.style({cursor:"move"});var I={element:E.node(),plotinfo:x,gd:t,editHelpers:P,isActiveShape:!0},R=o(k,t);l(R,E,I)}else t._context.edits.shapePosition?function(t,e,r,o,l,s){var c,f,v,y,x,T,k,M,A,L,S,C,O,D,z,P,E="pixel"===r.xsizemode,I="pixel"===r.ysizemode,R="line"===r.type,F="path"===r.type,N=s.modifyItem,B=i.getFromId(t,r.xref),H=i.getRefType(r.xref),j=i.getFromId(t,r.yref),U=i.getRefType(r.yref),V=g.getDataToPixel(t,B,!1,H),q=g.getDataToPixel(t,j,!0,U),G=g.getPixelToData(t,B,!1,H),Z=g.getPixelToData(t,j,!0,U),Y=R?function(){var t=Math.max(r.line.width,10),n=l.append("g").attr("data-index",o);n.append("path").attr("d",e.attr("d")).style({cursor:"move","stroke-width":t,"stroke-opacity":"0"});var a={"fill-opacity":"0"},i=Math.max(t/2,10);return n.append("circle").attr({"data-line-point":"start-point",cx:E?V(r.xanchor)+r.x0:V(r.x0),cy:I?q(r.yanchor)-r.y0:q(r.y0),r:i}).style(a).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:E?V(r.xanchor)+r.x1:V(r.x1),cy:I?q(r.yanchor)-r.y1:q(r.y1),r:i}).style(a).classed("cursor-grab",!0),n}():e,X={element:Y.node(),gd:t,prepFn:function(n){if(m(t))return;E&&(x=V(r.xanchor));I&&(T=q(r.yanchor));"path"===r.type?z=r.path:(c=E?r.x0:V(r.x0),f=I?r.y0:q(r.y0),v=E?r.x1:V(r.x1),y=I?r.y1:q(r.y1));c<v?(A=c,O="x0",L=v,D="x1"):(A=v,O="x1",L=c,D="x0");!I&&f<y||I&&f>y?(k=f,S="y0",M=y,C="y1"):(k=y,S="y1",M=f,C="y0");W(n),$(l,r),function(t,e,r){var n=e.xref,a=e.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(t,s?"clip"+r._fullLayout._uid+s:null,r)}(e,r,t),X.moveFn="move"===P?Q:J,X.altKey=n.altKey},doneFn:function(){if(m(t))return;p(e),K(l),b(e,t,r),n.call("_guiRelayout",t,s.getUpdateObj())},clickFn:function(){if(m(t))return;K(l)}};function W(r){if(m(t))P=null;else if(R)P="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=X.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(e,s),P=s.split("-")[0]}}function Q(n,a){if("path"===r.type){var i=function(t){return t},o=i,s=i;E?N("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(V(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),I?N("yanchor",r.yanchor=Z(T+a)):(s=function(t){return Z(q(t)+a)},j&&"date"===j.type&&(s=g.encodeDate(s))),N("path",r.path=w(z,o,s))}else E?N("xanchor",r.xanchor=G(x+n)):(N("x0",r.x0=G(c+n)),N("x1",r.x1=G(v+n))),I?N("yanchor",r.yanchor=Z(T+a)):(N("y0",r.y0=Z(f+a)),N("y1",r.y1=Z(y+a)));e.attr("d",_(t,r)),$(l,r)}function J(n,a){if(F){var i=function(t){return t},o=i,s=i;E?N("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(V(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),I?N("yanchor",r.yanchor=Z(T+a)):(s=function(t){return Z(q(t)+a)},j&&"date"===j.type&&(s=g.encodeDate(s))),N("path",r.path=w(z,o,s))}else if(R){if("resize-over-start-point"===P){var u=c+n,d=I?f-a:f+a;N("x0",r.x0=E?u:G(u)),N("y0",r.y0=I?d:Z(d))}else if("resize-over-end-point"===P){var p=v+n,h=I?y-a:y+a;N("x1",r.x1=E?p:G(p)),N("y1",r.y1=I?h:Z(h))}}else{var m=function(t){return-1!==P.indexOf(t)},b=m("n"),H=m("s"),U=m("w"),Y=m("e"),X=b?k+a:k,W=H?M+a:M,Q=U?A+n:A,J=Y?L+n:L;I&&(b&&(X=k-a),H&&(W=M-a)),(!I&&W-X>10||I&&X-W>10)&&(N(S,r[S]=I?X:Z(X)),N(C,r[C]=I?W:Z(W))),J-Q>10&&(N(O,r[O]=E?Q:G(Q)),N(D,r[D]=E?J:G(J)))}e.attr("d",_(t,r)),$(l,r)}function $(t,e){(E||I)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(E?e.xanchor:a.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,h.paramIsX))),o=q(I?e.yanchor:a.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,h.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),E&&I){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(E){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function K(t){t.selectAll(".visual-cue").remove()}d.init(X),Y.node().onmousemove=W}(t,E,s,e,r,P):!0===s.editable&&E.style("pointer-events",D||c.opacity(L)*A<=.5?"stroke":"all");E.node().addEventListener("click",(function(){return function(t,e){if(!y(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void T(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=T,v(t)}}(t,E)}))}}function b(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function _(t,e){var r,n,o,l,s,c,u,f,d=e.type,p=i.getRefType(e.xref),v=i.getRefType(e.yref),m=i.getFromId(t,e.xref),y=i.getFromId(t,e.yref),x=t._fullLayout._size;if(m?"domain"===p?n=function(t){return m._offset+m._length*t}:(r=g.shapePositionToRange(m),n=function(t){return m._offset+m.r2p(r(t,!0))}):n=function(t){return x.l+x.w*t},y?"domain"===v?l=function(t){return y._offset+y._length*(1-t)}:(o=g.shapePositionToRange(y),l=function(t){return y._offset+y.r2p(o(t,!0))}):l=function(t){return x.t+x.h*(1-t)},"path"===d)return m&&"date"===m.type&&(n=g.decodeDate(n)),y&&"date"===y.type&&(l=g.decodeDate(l)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,l=t.xanchor,s=t.yanchor;return n.replace(h.segmentRE,(function(t){var n=0,c=t.charAt(0),u=h.paramIsX[c],f=h.paramIsY[c],d=h.numParams[c],p=t.substr(1).replace(h.paramRE,(function(t){return u[n]?t="pixel"===i?e(l)+Number(t):e(t):f[n]&&(t="pixel"===o?r(s)-Number(t):r(t)),++n>d&&(t="X"),t}));return n>d&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),c+p}))}(e,n,l);if("pixel"===e.xsizemode){var b=n(e.xanchor);s=b+e.x0,c=b+e.x1}else s=n(e.x0),c=n(e.x1);if("pixel"===e.ysizemode){var _=l(e.yanchor);u=_-e.y0,f=_-e.y1}else u=l(e.y0),f=l(e.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 w=(s+c)/2,T=(u+f)/2,k=Math.abs(w-s),M=Math.abs(T-u),A="A"+k+","+M,L=w+k+","+T;return"M"+L+A+" 0 1,1 "+(w+","+(T-M))+A+" 0 0,1 "+L+"Z"}function w(t,e,r){return t.replace(h.segmentRE,(function(t){var n=0,a=t.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+t.substr(1).replace(h.paramRE,(function(t){return n>=l||(i[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function T(t){y(t)&&(t._fullLayout._activeShapeIndex>=0&&(s(t),delete t._fullLayout._activeShapeIndex,v(t)))}e.exports={draw:v,drawOne:x,eraseActiveShape:function(t){if(!y(t))return;s(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e<r.length){for(var a=[],i=0;i<r.length;i++)i!==e&&a.push(r[i]);delete t._fullLayout._activeShapeIndex,n.call("_guiRelayout",t,{shapes:a})}}}},{"../../lib":233,"../../lib/setcursor":253,"../../plot_api/plot_template":268,"../../plots/cartesian/axes":279,"../../plots/cartesian/handle_outline":289,"../../registry":326,"../color":105,"../dragelement":124,"../drawing":127,"./constants":184,"./draw_newshape/display_outlines":190,"./draw_newshape/helpers":191,"./helpers":193}],187:[function(t,e,r){"use strict";var n=t("../../drawing/attributes").dash,a=t("../../../lib/extend").extendFlat;e.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":227,"../../drawing/attributes":126}],188:[function(t,e,r){"use strict";e.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)}},{}],189:[function(t,e,r){"use strict";var n=t("../../color");e.exports=function(t,e,r){if(r("newshape.drawdirection"),r("newshape.layer"),r("newshape.fillcolor"),r("newshape.fillrule"),r("newshape.opacity"),r("newshape.line.width")){var a=(t||{}).plot_bgcolor||"#FFF";r("newshape.line.color",n.contrast(a)),r("newshape.line.dash")}r("activeshape.fillcolor"),r("activeshape.opacity")}},{"../../color":105}],190:[function(t,e,r){"use strict";var n=t("../../dragelement"),a=t("../../dragelement/helpers").drawMode,i=t("../../../registry"),o=t("./constants"),l=o.i000,s=o.i090,c=o.i180,u=o.i270,f=t("../../../plots/cartesian/handle_outline").clearOutlineControllers,d=t("./helpers"),p=d.pointsShapeRectangle,h=d.pointsShapeEllipse,g=d.writePaths,v=t("./newshapes");e.exports=function t(e,r,o,d){d||(d=0);var m=o.gd;function y(){t(e,r,o,d++),h(e[0])&&x({redrawing:!0})}function x(t){o.isActiveShape=!1;var e=v(r,o);Object.keys(e).length&&i.call((t||{}).redrawing?"relayout":"_guiRelayout",m,e)}var b,_,w,T,k,M=o.isActiveShape,A=m._fullLayout._zoomlayer,L=o.dragmode;(a(L)?m._fullLayout._drawing=!0:m._fullLayout._activeShapeIndex>=0&&f(m),r.attr("d",g(e)),M&&!d)&&(k=function(t,e){for(var r=0;r<e.length;r++){var n=e[r];t[r]=[];for(var a=0;a<n.length;a++){t[r][a]=[];for(var i=0;i<n[a].length;i++)t[r][a][i]=n[a][i]}}return t}([],e),function(t){b=[];for(var r=0;r<e.length;r++){var a=e[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=t.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:D},n.init(b[r][o])}}}(A.append("g").attr("class","outline-controllers")),function(){if(_=[],!e.length)return;_[0]={element:r[0][0],gd:m,prepFn:P,doneFn:E},n.init(_[0])}());function S(t){w=+t.srcElement.getAttribute("data-i"),T=+t.srcElement.getAttribute("data-j"),b[w][T].moveFn=C}function C(t,r){if(e.length){var n=k[w][T][1],a=k[w][T][2],i=e[w],o=i.length;if(p(i)){for(var l=0;l<o;l++)if(l!==T){var s=i[l];s[1]===i[T][1]&&(s[1]=n+t),s[2]===i[T][2]&&(s[2]=a+r)}if(i[T][1]=n+t,i[T][2]=a+r,!p(i))for(var c=0;c<o;c++)for(var u=0;u<i[c].length;u++)i[c][u]=k[w][c][u]}else i[T][1]=n+t,i[T][2]=a+r;y()}}function O(){x()}function D(t,r){if(2===t){w=+r.srcElement.getAttribute("data-i"),T=+r.srcElement.getAttribute("data-j");var n=e[w];p(n)||h(n)||function(){if(e.length&&e[w]&&e[w].length){for(var t=[],r=0;r<e[w].length;r++)r!==T&&t.push(e[w][r]);t.length>1&&(2!==t.length||"Z"!==t[1][0])&&(0===T&&(t[0][0]="M"),e[w]=t,y(),x())}}()}}function z(t,r){!function(t,r){if(e.length)for(var n=0;n<e.length;n++)for(var a=0;a<e[n].length;a++)for(var i=0;i+2<e[n][a].length;i+=2)e[n][a][i+1]=k[n][a][i+1]+t,e[n][a][i+2]=k[n][a][i+2]+r}(t,r),y()}function P(t){(w=+t.srcElement.getAttribute("data-i"))||(w=0),_[w].moveFn=z}function E(){x()}}},{"../../../plots/cartesian/handle_outline":289,"../../../registry":326,"../../dragelement":124,"../../dragelement/helpers":123,"./constants":188,"./helpers":191,"./newshapes":192}],191:[function(t,e,r){"use strict";var n=t("parse-svg-path"),a=t("./constants"),i=a.CIRCLE_SIDES,o=a.SQRT2,l=t("../../../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(t,e){return Math.abs(t-e)<=1e-6}function p(t,e){var r=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(r*r+n*n)}r.writePaths=function(t){var e=t.length;if(!e)return"M0,0Z";for(var r="",n=0;n<e;n++)for(var a=t[n].length,i=0;i<a;i++){var o=t[n][i][0];if("Z"===o)r+="Z";else for(var l=t[n][i].length,s=0;s<l;s++){var c=s;"Q"===o||"S"===o?c=f[s]:"C"===o&&(c=u[s]),r+=t[n][i][c],s>0&&s<l-1&&(r+=",")}}return r},r.readPaths=function(t,e,r,a){var o,l,u,f=n(t),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=[],T=f[m][0],k=T;switch(T){case"M":p++,d[p]=[],h=+f[m][1],g=+f[m][2],w.push([k,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([k,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([k,h,g,y,b,x,_]);break;case"T":case"L":h=+f[m][1],g=+f[m][2],w.push([k,h,g]);break;case"H":k="L",h=+f[m][1],w.push([k,h,g]);break;case"V":k="L",g=+f[m][1],w.push([k,h,g]);break;case"A":k="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([k,L+M*Math.cos(C),S+A*Math.sin(C)])}break;case"Z":h===l&&g===u||(h=l,g=u,w.push([k,h,g]))}for(var O=(r||{}).domain,D=e._fullLayout._size,z=r&&"pixel"===r.xsizemode,P=r&&"pixel"===r.ysizemode,E=!1===a,I=0;I<w.length;I++){for(o=0;o+2<7;o+=2){var R=w[I][o+1],F=w[I][o+2];void 0!==R&&void 0!==F&&(h=R,g=F,r&&(r.xaxis&&r.xaxis.p2r?(E&&(R-=r.xaxis._offset),R=z?c(r.xaxis,r.xanchor)+R:s(r.xaxis,R)):(E&&(R-=D.l),O?R=O.x[0]+R/D.w:R/=D.w),r.yaxis&&r.yaxis.p2r?(E&&(F-=r.yaxis._offset),F=P?c(r.yaxis,r.yanchor)-F:s(r.yaxis,F)):(E&&(F-=D.t),F=O?O.y[1]-F/D.h:1-F/D.h)),w[I][o+1]=R,w[I][o+2]=F)}d[p].push(w[I].slice())}}return d},r.pointsShapeRectangle=function(t){if(5!==t.length)return!1;for(var e=1;e<3;e++){if(!d(t[0][e]-t[1][e],t[3][e]-t[2][e]))return!1;if(!d(t[0][e]-t[3][e],t[1][e]-t[2][e]))return!1}return!(!d(t[0][1],t[1][1])&&!d(t[0][1],t[3][1]))&&!!(p(t[0],t[1])*p(t[0],t[3]))},r.pointsShapeEllipse=function(t){var e=t.length;if(e!==i+1)return!1;e=i;for(var r=0;r<e;r++){var n=(2*e-r)%e,a=(e/2+n)%e,o=(e/2+r)%e;if(!d(p(t[r],t[o]),p(t[n],t[a])))return!1}return!0},r.handleEllipse=function(t,e,n){if(!t)return[e,n];var a=r.ellipseOver({x0:e[0],y0:e[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(t){var e=t.x0,r=t.y0,n=t.x1,a=t.y1,i=n-e,l=a-r,s=((e-=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":290,"./constants":188,"parse-svg-path":77}],192:[function(t,e,r){"use strict";var n=t("../../dragelement/helpers"),a=n.drawMode,i=n.openMode,o=t("./constants"),l=o.i000,s=o.i090,c=o.i180,u=o.i270,f=o.cos45,d=o.sin45,p=t("../../../plots/cartesian/helpers"),h=p.p2r,g=p.r2p,v=t("../../../plots/cartesian/handle_outline").clearSelect,m=t("./helpers"),y=m.readPaths,x=m.writePaths,b=m.ellipseOver;e.exports=function(t,e){if(t.length){var r=t[0][0];if(r){var n=r.getAttribute("d"),o=e.gd,p=o._fullLayout.newshape,m=e.plotinfo,_=m.xaxis,w=m.yaxis,T=!!m.domain||!m.xaxis,k=!!m.domain||!m.yaxis,M=e.isActiveShape,A=e.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,D=i(A),z=y(n,o,m,M),P={editable:!0,xref:T?"paper":_._id,yref:k?"paper":w._id,layer:p.layer,opacity:p.opacity,line:{color:p.line.color,width:p.line.width,dash:p.line.dash}};if(D||(P.fillcolor=p.fillcolor,P.fillrule=p.fillrule),1===z.length&&(O=z[0]),O&&"drawrect"===A)P.type="rect",P.x0=O[0][1],P.y0=O[0][2],P.x1=O[2][1],P.y1=O[2][2];else if(O&&"drawline"===A)P.type="line",P.x0=O[0][1],P.y0=O[0][2],P.x1=O[1][1],P.y1=O[1][2];else if(O&&"drawcircle"===A){P.type="circle";var E=O[l][1],I=O[s][1],R=O[c][1],F=O[u][1],N=O[l][2],B=O[s][2],H=O[c][2],j=O[u][2],U=m.xaxis&&("date"===m.xaxis.type||"log"===m.xaxis.type),V=m.yaxis&&("date"===m.yaxis.type||"log"===m.yaxis.type);U&&(E=g(m.xaxis,E),I=g(m.xaxis,I),R=g(m.xaxis,R),F=g(m.xaxis,F)),V&&(N=g(m.yaxis,N),B=g(m.yaxis,B),H=g(m.yaxis,H),j=g(m.yaxis,j));var q=(I+F)/2,G=(N+H)/2,Z=b({x0:q,y0:G,x1:q+(F-I+R-E)/2*f,y1:G+(j-B+H-N)/2*d});U&&(Z.x0=h(m.xaxis,Z.x0),Z.x1=h(m.xaxis,Z.x1)),V&&(Z.y0=h(m.yaxis,Z.y0),Z.y1=h(m.yaxis,Z.y1)),P.x0=Z.x0,P.y0=Z.y0,P.x1=Z.x1,P.y1=Z.y1}else P.type="path",_&&w&&function(t,e,r){var n="date"===e.type,a="date"===r.type;if(!n&&!a)return t;for(var i=0;i<t.length;i++)for(var o=0;o<t[i].length;o++)for(var l=0;l+2<t[i][o].length;l+=2)n&&(t[i][o][l+1]=t[i][o][l+1].replace(" ","_")),a&&(t[i][o][l+2]=t[i][o][l+2].replace(" ","_"))}(z,_,w),P.path=x(z),O=null;v(o);for(var Y=e.editHelpers,X=(Y||{}).modifyItem,W=[],Q=0;Q<L.length;Q++){var J=o._fullLayout.shapes[Q];if(W[Q]=J._input,void 0!==M&&Q===o._fullLayout._activeShapeIndex){var $=P;switch(J.type){case"line":case"rect":case"circle":X("x0",$.x0),X("x1",$.x1),X("y0",$.y0),X("y1",$.y1);break;case"path":X("path",$.path)}}}return void 0===M?(W.push(P),W):Y?Y.getUpdateObj():{}}}}},{"../../../plots/cartesian/handle_outline":289,"../../../plots/cartesian/helpers":290,"../../dragelement/helpers":123,"./constants":188,"./helpers":191}],193:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../lib");r.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},r.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},r.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},r.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},r.extractPathCoords=function(t,e){var r=[];return t.match(n.segmentRE).forEach((function(t){var i=e[t.charAt(0)].drawn;if(void 0!==i){var o=t.substr(1).match(n.paramRE);!o||o.length<i||r.push(a.cleanNumber(o[i]))}})),r},r.getDataToPixel=function(t,e,n,a){var i,o=t._fullLayout._size;if(e)if("domain"===a)i=function(t){return e._length*(n?1-t:t)+e._offset};else{var l=r.shapePositionToRange(e);i=function(t){return e._offset+e.r2p(l(t,!0))},"date"===e.type&&(i=r.decodeDate(i))}else i=n?function(t){return o.t+o.h*(1-t)}:function(t){return o.l+o.w*t};return i},r.getPixelToData=function(t,e,n,a){var i,o=t._fullLayout._size;if(e)if("domain"===a)i=function(t){var r=(t-e._offset)/e._length;return n?1-r:r};else{var l=r.rangeToShapePosition(e);i=function(t){return l(e.p2r(t-e._offset))}}else i=n?function(t){return 1-(t-o.t)/o.h}:function(t){return(t-o.l)/o.w};return i},r.roundPositionForSharpStrokeRendering=function(t,e){var r=1===Math.round(e%2),n=Math.round(t);return r?n+.5:n},r.makeOptionsAndPlotinfo=function(t,e){var r=t._fullLayout.shapes[e]||{},n=t._fullLayout._plots[r.xref+r.yref];return!!n?n._hadPlotinfo=!0:(n={},r.xref&&"paper"!==r.xref&&(n.xaxis=t._fullLayout[r.xref+"axis"]),r.yref&&"paper"!==r.yref&&(n.yaxis=t._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":233,"./constants":184}],194:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),supplyDrawNewShapeDefaults:t("./draw_newshape/defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("shapes"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":291,"./attributes":182,"./calc_autorange":183,"./defaults":185,"./draw":186,"./draw_newshape/defaults":189}],195:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../../plots/pad_attributes"),i=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/animation_attributes"),s=t("../../plot_api/plot_template").templatedArray,c=t("./constants"),u=s("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(s("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(a({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:l.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:c.gripBgActiveColor},bgcolor:{valType:"color",dflt:c.railBgColor},bordercolor:{valType:"color",dflt:c.railBorderColor},borderwidth:{valType:"number",min:0,dflt:c.railBorderWidth},ticklen:{valType:"number",min:0,dflt:c.tickLength},tickcolor:{valType:"color",dflt:c.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:c.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":227,"../../plot_api/edit_types":261,"../../plot_api/plot_template":268,"../../plots/animation_attributes":273,"../../plots/font_attributes":307,"../../plots/pad_attributes":312,"./constants":196}],196:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],197:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,l=i.steps;function s(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}for(var l=a(t,e,{name:"steps",handleItemDefaults:c}),s=0,u=0;u<l.length;u++)l[u].visible&&s++;if(s<2?e.visible=!1:o("visible")){e._stepCount=s;var f=e._visibleSteps=n.filterVisible(l);(l[o("active")]||{}).visible||(e.active=f[0]._index),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("len"),o("lenmode"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("currentvalue.visible")&&(o("currentvalue.xanchor"),o("currentvalue.prefix"),o("currentvalue.suffix"),o("currentvalue.offset"),n.coerceFont(o,"currentvalue.font",e.font)),o("transition.duration"),o("transition.easing"),o("bgcolor"),o("activebgcolor"),o("bordercolor"),o("borderwidth"),o("ticklen"),o("tickwidth"),o("tickcolor"),o("minorticklen")}}function c(t,e){function r(r,a){return n.coerce(t,e,l,r,a)}if("skip"===t.method||Array.isArray(t.args)?r("visible"):e.visible=!1){r("method"),r("args");var a=r("label","step-"+e._index);r("value",a),r("execute")}}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:s})}},{"../../lib":233,"../../plots/array_container_defaults":274,"./attributes":195,"./constants":196}],198:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),l=t("../../lib"),s=l.strTranslate,c=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,f=t("./constants"),d=t("../../constants/alignment"),p=d.LINE_SPACING,h=d.FROM_TL,g=d.FROM_BR;function v(t){return f.autoMarginIdRoot+t._index}function m(t){return t._index}function y(t,e){var r=o.tester.selectAll("g."+f.labelGroupClass).data(e._visibleSteps);r.enter().append("g").classed(f.labelGroupClass,!0);var i=0,s=0;r.each((function(t){var r=_(n.select(this),{step:t},e).node();if(r){var a=o.bBox(r);s=Math.max(s,a.height),i=Math.max(i,a.width)}})),r.remove();var u=e._dims={};u.inputAreaWidth=Math.max(f.railWidth,f.gripHeight);var d=t._fullLayout._size;u.lx=d.l+d.w*e.x,u.ly=d.t+d.h*(1-e.y),"fraction"===e.lenmode?u.outerLength=Math.round(d.w*e.len):u.outerLength=e.len,u.inputAreaStart=0,u.inputAreaLength=Math.round(u.outerLength-e.pad.l-e.pad.r);var p=(u.inputAreaLength-2*f.stepInset)/(e._stepCount-1),m=i+f.labelPadding;if(u.labelStride=Math.max(1,Math.ceil(m/p)),u.labelHeight=s,u.currentValueMaxWidth=0,u.currentValueHeight=0,u.currentValueTotalHeight=0,u.currentValueMaxLines=1,e.currentvalue.visible){var y=o.tester.append("g");r.each((function(t){var r=x(y,e,t.label),n=r.node()&&o.bBox(r.node())||{width:0,height:0},a=c.lineCount(r);u.currentValueMaxWidth=Math.max(u.currentValueMaxWidth,Math.ceil(n.width)),u.currentValueHeight=Math.max(u.currentValueHeight,Math.ceil(n.height)),u.currentValueMaxLines=Math.max(u.currentValueMaxLines,a)})),u.currentValueTotalHeight=u.currentValueHeight+e.currentvalue.offset,y.remove()}u.height=u.currentValueTotalHeight+f.tickOffset+e.ticklen+f.labelOffset+u.labelHeight+e.pad.t+e.pad.b;var b="left";l.isRightAnchor(e)&&(u.lx-=u.outerLength,b="right"),l.isCenterAnchor(e)&&(u.lx-=u.outerLength/2,b="center");var w="top";l.isBottomAnchor(e)&&(u.ly-=u.height,w="bottom"),l.isMiddleAnchor(e)&&(u.ly-=u.height/2,w="middle"),u.outerLength=Math.ceil(u.outerLength),u.height=Math.ceil(u.height),u.lx=Math.round(u.lx),u.ly=Math.round(u.ly);var T={y:e.y,b:u.height*g[w],t:u.height*h[w]};"fraction"===e.lenmode?(T.l=0,T.xl=e.x-e.len*h[b],T.r=0,T.xr=e.x+e.len*g[b]):(T.x=e.x,T.l=u.outerLength*h[b],T.r=u.outerLength*g[b]),a.autoMargin(t,v(e),T)}function x(t,e,r){if(e.currentvalue.visible){var n,a,i=e._dims;switch(e.currentvalue.xanchor){case"right":n=i.inputAreaLength-f.currentValueInset-i.currentValueMaxWidth,a="left";break;case"center":n=.5*i.inputAreaLength,a="middle";break;default:n=f.currentValueInset,a="left"}var s=l.ensureSingle(t,"text",f.labelClass,(function(t){t.attr({"text-anchor":a,"data-notex":1})})),u=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)u+=r;else{var d=e.steps[e.active].label,h=e._gd._fullLayout._meta;h&&(d=l.templateString(d,h)),u+=d}e.currentvalue.suffix&&(u+=e.currentvalue.suffix),s.call(o.font,e.currentvalue.font).text(u).call(c.convertToTspans,e._gd);var g=c.lineCount(s),v=(i.currentValueMaxLines+1-g)*e.currentvalue.font.size*p;return c.positionText(s,n,v),s}}function b(t,e,r){l.ensureSingle(t,"rect",f.gripRectClass,(function(n){n.call(M,e,t,r).style("pointer-events","all")})).attr({width:f.gripWidth,height:f.gripHeight,rx:f.gripRadius,ry:f.gripRadius}).call(i.stroke,r.bordercolor).call(i.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function _(t,e,r){var n=l.ensureSingle(t,"text",f.labelClass,(function(t){t.attr({"text-anchor":"middle","data-notex":1})})),a=e.step.label,i=r._gd._fullLayout._meta;return i&&(a=l.templateString(a,i)),n.call(o.font,r.font).text(a).call(c.convertToTspans,r._gd),n}function w(t,e){var r=l.ensureSingle(t,"g",f.labelsClass),a=e._dims,i=r.selectAll("g."+f.labelGroupClass).data(a.labelSteps);i.enter().append("g").classed(f.labelGroupClass,!0),i.exit().remove(),i.each((function(t){var r=n.select(this);r.call(_,t,e),o.setTranslate(r,S(e,t.fraction),f.tickOffset+e.ticklen+e.font.size*p+f.labelOffset+a.currentValueTotalHeight)}))}function T(t,e,r,n,a){var i=Math.round(n*(r._stepCount-1)),o=r._visibleSteps[i]._index;o!==r.active&&k(t,e,r,o,!0,a)}function k(t,e,r,n,i,o){var l=r.active;r.active=n,u(t.layout,f.name,r).applyUpdate("active",n);var s=r.steps[r.active];e.call(L,r,o),e.call(x,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:l}),s&&s.method&&i&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=i,e._nextMethod.doTransition=o):(e._nextMethod={step:s,doCallback:i,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame((function(){var r=e._nextMethod.step;r.method&&(r.execute&&a.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)}))))}function M(t,e,r){var a=r.node(),o=n.select(e);function l(){return r.data()[0]}t.on("mousedown",(function(){var t=l();e.emit("plotly_sliderstart",{slider:t});var s=r.select("."+f.gripRectClass);n.event.stopPropagation(),n.event.preventDefault(),s.call(i.fill,t.activebgcolor);var c=C(t,n.mouse(a)[0]);T(e,r,t,c,!0),t._dragging=!0,o.on("mousemove",(function(){var t=l(),i=C(t,n.mouse(a)[0]);T(e,r,t,i,!1)})),o.on("mouseup",(function(){var t=l();t._dragging=!1,s.call(i.fill,t.bgcolor),o.on("mouseup",null),o.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})}))}))}function A(t,e){var r=t.selectAll("rect."+f.tickRectClass).data(e._visibleSteps),a=e._dims;r.enter().append("rect").classed(f.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each((function(t,r){var l=r%a.labelStride==0,s=n.select(this);s.attr({height:l?e.ticklen:e.minorticklen}).call(i.fill,e.tickcolor),o.setTranslate(s,S(e,r/(e._stepCount-1))-.5*e.tickwidth,(l?f.tickOffset:f.minorTickOffset)+a.currentValueTotalHeight)}))}function L(t,e,r){for(var n=t.select("rect."+f.gripRectClass),a=0,i=0;i<e._stepCount;i++)if(e._visibleSteps[i]._index===e.active){a=i;break}var o=S(e,a/(e._stepCount-1));if(!e._invokingCommand){var l=n;r&&e.transition.duration>0&&(l=l.transition().duration(e.transition.duration).ease(e.transition.easing)),l.attr("transform",s(o-.5*f.gripWidth,e._dims.currentValueTotalHeight))}}function S(t,e){var r=t._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,e))}function C(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function O(t,e,r){var n=r._dims,a=l.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(M,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function D(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,a=l.ensureSingle(t,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[f.name],n=[],a=0;a<r.length;a++){var i=r[a];i.visible&&(i._gd=e,n.push(i))}return n}(e,t),i=e._infolayer.selectAll("g."+f.containerClassName).data(r.length>0?[0]:[]);function l(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,v(e))}if(i.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+f.groupClassName).data(r,m);s.enter().append("g").classed(f.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c<r.length;c++){var u=r[c];y(t,u)}s.each((function(e){var r=n.select(this);!function(t){var e=t._dims;e.labelSteps=[];for(var r=t._stepCount,n=0;n<r;n+=e.labelStride)e.labelSteps.push({fraction:n/(r-1),step:t._visibleSteps[n]})}(e),a.manageCommandObserver(t,e,e._visibleSteps,(function(e){var n=r.data()[0];n.active!==e.index&&(n._dragging||k(t,r,n,e.index,!1,!0))})),function(t,e,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index);e.call(x,r).call(D,r).call(w,r).call(A,r).call(O,t,r).call(b,t,r);var n=r._dims;o.setTranslate(e,n.lx+r.pad.l,n.ly+r.pad.t),e.call(L,r,!1),e.call(x,r)}(t,n.select(this),e)}))}}},{"../../constants/alignment":207,"../../lib":233,"../../lib/svg_text_utils":255,"../../plot_api/plot_template":268,"../../plots/plots":313,"../color":105,"../drawing":127,"./constants":196,d3:21}],199:[function(t,e,r){"use strict";var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":195,"./constants":196,"./defaults":197,"./draw":198}],200:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../lib"),s=l.strTranslate,c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),d=t("../../constants/interactions"),p=t("../../constants/alignment").OPPOSITE_SIDE,h=/ [XY][0-9]* /;e.exports={draw:function(t,e,r){var g,v=r.propContainer,m=r.propName,y=r.placeholder,x=r.traceIndex,b=r.avoid||{},_=r.attributes,w=r.transform,T=r.containerGroup,k=t._fullLayout,M=1,A=!1,L=v.title,S=(L&&L.text?L.text:"").trim(),C=L&&L.font?L.font:{},O=C.family,D=C.size,z=C.color;"title.text"===m?g="titleText":-1!==m.indexOf("axis")?g="axisTitleText":m.indexOf(!0)&&(g="colorbarTitleText");var P=t._context.edits[g];""===S?M=0:S.replace(h," % ")===y.replace(h," % ")&&(M=.2,A=!0,P||(S="")),r._meta?S=l.templateString(S,r._meta):k._meta&&(S=l.templateString(S,k._meta));var E=S||P;T||(T=l.ensureSingle(k._infolayer,"g","g-"+e));var I=T.selectAll("text").data(E?[0]:[]);if(I.enter().append("text"),I.text(S).attr("class",e),I.exit().remove(),!E)return T;function R(t){l.syncOrAsync([F,N],t)}function F(e){var r;return w?(r="",w.rotate&&(r+="rotate("+[w.rotate,_.x,_.y]+")"),w.offset&&(r+=s(0,w.offset))):r=null,e.attr("transform",r),e.style({"font-family":O,"font-size":n.round(D,2)+"px",fill:u.rgb(z),opacity:M*u.opacity(z),"font-weight":i.fontWeight}).attr(_).call(f.convertToTspans,t),i.previousPromises(t)}function N(t){var e=n.select(t.node().parentNode);if(b&&b.selection&&b.side&&S){e.attr("transform",null);var r=p[b.side],i="left"===b.side||"top"===b.side?-1:1,o=a(b.pad)?b.pad:2,u=c.bBox(e.node()),f={left:0,top:0,right:k.width,bottom:k.height},d=b.maxShift||i*(f[b.side]-u[b.side]),h=0;if(d<0)h=d;else{var g=b.offsetLeft||0,v=b.offsetTop||0;u.left-=g,u.right-=g,u.top-=v,u.bottom-=v,b.selection.each((function(){var t=c.bBox(this);l.bBoxIntersect(u,t,o)&&(h=Math.max(h,i*(t[b.side]-u[r])+o))})),h=Math.min(d,h)}if(h>0||d<0){var m={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[b.side];e.attr("transform",s(m[0],m[1]))}}}return I.call(R),P&&(S?I.on(".opacity",null):(M=0,A=!0,I.text(y).on("mouseover.opacity",(function(){n.select(this).transition().duration(d.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(d.HIDE_PLACEHOLDER).style("opacity",0)}))),I.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==x?o.call("_guiRestyle",t,m,e,x):o.call("_guiRelayout",t,m,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(R)})).on("input",(function(t){this.text(t||" ").call(f.positionText,_.x,_.y)}))),I.classed("js-placeholder",A),T}}},{"../../constants/alignment":207,"../../constants/interactions":211,"../../lib":233,"../../lib/svg_text_utils":255,"../../plots/plots":313,"../../registry":326,"../color":105,"../drawing":127,d3:21,"fast-isnumeric":23}],201:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/pad_attributes"),s=t("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":227,"../../plot_api/edit_types":261,"../../plot_api/plot_template":268,"../../plots/font_attributes":307,"../../plots/pad_attributes":312,"../color/attributes":104}],202:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],203:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,l=i.buttons;function s(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(t,e){function r(r,a){return n.coerce(t,e,l,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:s})}},{"../../lib":233,"../../plots/array_container_defaults":274,"./attributes":201,"./constants":202}],204:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),d=t("./scrollbox");function p(t){return t._index}function h(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,a,i,o,l){e.active=o,c(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(a.attr(f.menuIndexAttrName,"-1"),v(t,n,a,i,e),l||m(t,n,a,i,e))}function v(t,e,r,n,a){var i=l.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,t).call(A,a,d,p),l.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(h(r,a)?-1:a._index)),m(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(e,s.lx,s.ly)}function m(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var s=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,m=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?v=m.headerHeight+f.gapButtonHeader:h=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-m.openWidth);var b={x:m.lx+h+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},k={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(y,o,l,t).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(t,o,0,e,r,i,-1),a.executeAPICommand(t,l.method,l.args2)):(g(t,o,0,e,r,i,s),a.executeAPICommand(t,l.method,l.args))),t.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(k.w=Math.max(m.openWidth,m.headerWidth),k.h=b.y-k.t):(k.w=b.x-k.l,k.h=Math.max(m.openHeight,m.headerHeight)),k.direction=o.direction,i&&(u.size()?function(t,e,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s<p;s++)l+=d.heights[s]+f.gapButton;else for(o=0,s=0;s<p;s++)o+=d.widths[s]+f.gapButton;n.enable(i,o,l),n.hbar&&n.hbar.attr("opacity","0").transition().attr("opacity","1");n.vbar&&n.vbar.attr("opacity","0").transition().attr("opacity","1")}(0,0,0,i,o,k):function(t){var e=!!t.hbar,r=!!t.vbar;e&&t.hbar.transition().attr("opacity","0").each("end",(function(){e=!1,r||t.disable()}));r&&t.vbar.transition().attr("opacity","0").each("end",(function(){r=!1,e||t.disable()}))}(i))}function y(t,e,r,n){t.call(x,e).call(b,e,r,n)}function x(t,e){l.ensureSingle(t,"rect",f.itemRectClassName,(function(t){t.attr({rx:f.rx,ry:f.ry,"shape-rendering":"crispEdges"})})).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function b(t,e,r,n){var a=l.ensureSingle(t,"text",f.itemTextClassName,(function(t){t.attr({"text-anchor":"start","data-notex":1})})),i=r.label,c=n._fullLayout._meta;c&&(i=l.templateString(i,c)),a.call(o.font,e.font).text(i).call(s.convertToTspans,n)}function _(t,e){var r=e.active;t.each((function(t,a){var o=n.select(this);a===r&&e.showactive&&o.select("rect."+f.itemRectClassName).call(i.fill,f.activeColor)}))}function w(t){t.select("rect."+f.itemRectClassName).call(i.fill,f.hoverColor)}function T(t,e){t.select("rect."+f.itemRectClassName).call(i.fill,e.bgcolor)}function k(t,e){var r=e._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},i=o.tester.selectAll("g."+f.dropdownButtonClassName).data(l.filterVisible(e.buttons));i.enter().append("g").classed(f.dropdownButtonClassName,!0);var c=-1!==["up","down"].indexOf(e.direction);i.each((function(a,i){var l=n.select(this);l.call(y,e,a,t);var d=l.select("."+f.itemTextClassName),p=d.node()&&o.bBox(d.node()).width,h=Math.max(p+f.textPadX,f.minWidth),g=e.font.size*u,v=s.lineCount(d),m=Math.max(g*v,f.minHeight)+f.textOffsetY;m=Math.ceil(m),h=Math.ceil(h),r.widths[i]=h,r.heights[i]=m,r.height1=Math.max(r.height1,m),r.width1=Math.max(r.width1,h),c?(r.totalWidth=Math.max(r.totalWidth,h),r.openWidth=r.totalWidth,r.totalHeight+=m+f.gapButton,r.openHeight+=m+f.gapButton):(r.totalWidth+=h+f.gapButton,r.openWidth+=h+f.gapButton,r.totalHeight=Math.max(r.totalHeight,m),r.openHeight=r.totalHeight)})),c?r.totalHeight-=f.gapButton:r.totalWidth-=f.gapButton,r.headerWidth=r.width1+f.arrowPadX,r.headerHeight=r.height1,"dropdown"===e.type&&(c?(r.width1+=f.arrowPadX,r.totalHeight=r.height1):r.totalWidth=r.width1,r.totalWidth+=f.arrowPadX),i.remove();var d=r.totalWidth+e.pad.l+e.pad.r,p=r.totalHeight+e.pad.t+e.pad.b,h=t._fullLayout._size;r.lx=h.l+h.w*e.x,r.ly=h.t+h.h*(1-e.y);var g="left";l.isRightAnchor(e)&&(r.lx-=d,g="right"),l.isCenterAnchor(e)&&(r.lx-=d/2,g="center");var v="top";l.isBottomAnchor(e)&&(r.ly-=p,v="bottom"),l.isMiddleAnchor(e)&&(r.ly-=p/2,v="middle"),r.totalWidth=Math.ceil(r.totalWidth),r.totalHeight=Math.ceil(r.totalHeight),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),a.autoMargin(t,M(e),{x:e.x,y:e.y,l:d*({right:1,center:.5}[g]||0),r:d*({left:1,center:.5}[g]||0),b:p*({top:1,middle:.5}[v]||0),t:p*({bottom:1,middle:.5}[v]||0)})}function M(t){return f.autoMarginIdRoot+t._index}function A(t,e,r,n){n=n||{};var a=t.select("."+f.itemRectClassName),i=t.select("."+f.itemTextClassName),l=e.borderwidth,c=r.index,d=e._dims;o.setTranslate(t,l+r.x,l+r.y);var p=-1!==["up","down"].indexOf(e.direction),h=n.height||(p?d.heights[c]:d.height1);a.attr({x:0,y:0,width:n.width||(p?d.width1:d.widths[c]),height:h});var g=e.font.size*u,v=(s.lineCount(i)-1)*g/2;s.positionText(i,f.textOffsetX,h/2-v+f.textOffsetY),p?r.y+=d.heights[c]+r.yPad:r.x+=d.widths[c]+r.xPad,r.index++}function L(t,e){t.attr(f.menuIndexAttrName,e||"-1").selectAll("g."+f.dropdownButtonClassName).remove()}e.exports=function(t){var e=t._fullLayout,r=l.filterVisible(e[f.name]);function i(e){a.autoMargin(t,M(e))}var o=e._menulayer.selectAll("g."+f.containerClassName).data(r.length>0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),u=0;u<r.length;u++){var y=r[u];k(t,y)}var x="updatemenus"+e._uid,b=new d(t,c,x);s.enter().size()&&(c.node().parentNode.appendChild(c.node()),c.call(L)),s.exit().each((function(t){c.call(L),i(t)})).remove(),s.each((function(e){var r=n.select(this),i="dropdown"===e.type?c:null;a.manageCommandObserver(t,e,e.buttons,(function(n){g(t,e,e.buttons[n.index],r,i,b,n.index,!0)})),"dropdown"===e.type?(v(t,r,c,b,e),h(c,e)&&m(t,r,c,b,e)):m(t,r,null,null,e)}))}}},{"../../constants/alignment":207,"../../lib":233,"../../lib/svg_text_utils":255,"../../plot_api/plot_template":268,"../../plots/plots":313,"../color":105,"../drawing":127,"./constants":202,"./scrollbox":206,d3:21}],205:[function(t,e,r){arguments[4][199][0].apply(r,arguments)},{"./attributes":201,"./constants":202,"./defaults":203,"./draw":204,dup:199}],206:[function(t,e,r){"use strict";e.exports=l;var n=t("d3"),a=t("../color"),i=t("../drawing"),o=t("../../lib");function l(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}l.barWidth=2,l.barLength=20,l.barRadius=2,l.barPad=1,l.barColor="#808BA4",l.prototype.enable=function(t,e,r){var o=this.gd._fullLayout,s=o.width,c=o.height;this.position=t;var u,f,d,p,h=this.position.l,g=this.position.w,v=this.position.t,m=this.position.h,y=this.position.direction,x="down"===y,b="left"===y,_="up"===y,w=g,T=m;x||b||"right"===y||_||(this.position.direction="down",x=!0),x||_?(f=(u=h)+w,x?(d=v,T=(p=Math.min(d+T,c))-d):T=(p=v+T)-(d=Math.max(p-T,0))):(p=(d=v)+T,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:T};var k=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(k?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),k?(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>T,D=l.barWidth+2*l.barPad,z=l.barLength+2*l.barPad,P=h+g,E=v;P+D>s&&(P=s-D);var I=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=I.attr({rx:l.barRadius,ry:l.barRadius,x:P,y:E,width:D,height:z}),this._vbarYMin=E+z/2,this._vbarTranslateMax=T-z):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,N=O?f+D+.5:f+.5,B=d-.5,H=k?p+A+.5:p+.5,j=o._topdefs.selectAll("#"+R).data(k||O?[0]:[]);if(j.exit().remove(),j.enter().append("clipPath").attr("id",R).append("rect"),k||O?(this._clipRect=j.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(H)-Math.floor(B)}),this.container.call(i.setClipUrl,R,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),k||O){var U=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(U);var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(V),O&&this.vbar.on(".drag",null).call(V)}this.setTranslate(e,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},l.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},l.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,l=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},l.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var l=e/n;this.vbar.call(i.setTranslate,t,e+l*this._vbarTranslateMax)}}},{"../../lib":233,"../color":105,"../drawing":127,d3:21}],207:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],208:[function(t,e,r){"use strict";e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}},{}],209:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format#locale_format"}},{}],210:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],211:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],212:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],213:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],214:[function(t,e,r){"use strict";r.version=t("./version").version,t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),l=0;l<o.length;l++){var s=o[l];"_"!==s.charAt(0)&&(r[s]=i[s]),a({moduleType:"apiMethod",name:s,fn:i[s]})}a(t("./traces/scatter")),a([t("./components/legend"),t("./components/fx"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector"),t("./components/grid"),t("./components/errorbars"),t("./components/colorscale"),t("./components/colorbar")]),a([t("./locale-en"),t("./locale-en-us")]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(a(window.PlotlyLocales),delete window.PlotlyLocales),r.Icons=t("./fonts/ploticon"),r.Plots=t("./plots/plots"),r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"./components/annotations":98,"./components/annotations3d":103,"./components/colorbar":111,"./components/colorscale":117,"./components/errorbars":133,"./components/fx":145,"./components/grid":149,"./components/images":154,"./components/legend":162,"./components/rangeselector":173,"./components/rangeslider":180,"./components/shapes":194,"./components/sliders":199,"./components/updatemenus":205,"./fonts/mathjax_config":215,"./fonts/ploticon":216,"./lib/queue":248,"./locale-en":259,"./locale-en-us":258,"./plot_api":263,"./plot_api/plot_schema":267,"./plots/plots":313,"./registry":326,"./snapshot":331,"./traces/scatter":459,"./version":494,d3:21,"es6-promise":22}],215:[function(t,e,r){"use strict";e.exports=function(){"undefined"!=typeof MathJax&&("local"!==(window.PlotlyConfig||{}).MathJaxConfig&&(MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()))}},{}],216:[function(t,e,r){"use strict";e.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},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>"}}},{}],217:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],218:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(t){return Math.abs(t[1]-t[0])>l-1e-14}function c(t,e){return i(e-t,l)}function u(t,e){if(s(e))return!0;var r,n;e[0]<e[1]?(r=e[0],n=e[1]):(r=e[1],n=e[0]),(r=a(r,l))>(n=a(n,l))&&(n+=l);var i=a(t,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(t,e,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}g?(u=0,f=o,d=l):r<n?(u=r,d=n):(u=n,d=r),t<e?(p=t,h=e):(p=e,h=t);var m,y=Math.abs(d-u)<=o?0:1;function x(t,e,r){return"A"+[t,t]+" "+[0,y,r]+" "+v(t,e)}return g?m=null===p?"M"+v(h,u)+x(h,f,0)+x(h,d,0)+"Z":"M"+v(p,u)+x(p,f,0)+x(p,d,0)+"ZM"+v(h,u)+x(h,f,1)+x(h,d,1)+"Z":null===p?(m="M"+v(h,u)+x(h,d,0),c&&(m+="L0,0Z")):m="M"+v(p,u)+"L"+v(h,u)+x(h,d,0)+"L"+v(p,d)+x(p,u,1)+"Z",m}e.exports={deg2rad:function(t){return t/180*o},rad2deg:function(t){return t/o*180},angleDelta:c,angleDist:function(t,e){return Math.abs(c(t,e))},isFullCircle:s,isAngleInsideSector:u,isPtInsideSector:function(t,e,r,n){return!!u(e,n)&&(r[0]<r[1]?(a=r[0],i=r[1]):(a=r[1],i=r[0]),t>=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return f(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return f(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return f(t,e,r,n,a,i,1)}}},{"./mod":240}],219:[function(t,e,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function l(t){return n(t)||o(t)}function s(t,e,r){if(l(t)){if(l(t[0])){for(var n=r,a=0;a<t.length;a++)n=e(n,t[a].length);return n}return t.length}return 0}r.isTypedArray=o,r.isArrayOrTypedArray=l,r.isArray1D=function(t){return!l(t[0])},r.ensureArray=function(t,e){return n(t)||(t=[]),t.length=e,t},r.concat=function(){var t,e,r,a,i,o,l,s,c=[],u=!0,f=0;for(r=0;r<arguments.length;r++)(o=(a=arguments[r]).length)&&(e?c.push(a):(e=a,i=o),n(a)?t=!1:(u=!1,f?t!==a.constructor&&(t=!1):t=a.constructor),f+=o);if(!f)return[];if(!c.length)return e;if(u)return e.concat.apply(e,c);if(t){for((l=new t(f)).set(e),r=0;r<c.length;r++)a=c[r],l.set(a,i),i+=a.length;return l}for(l=new Array(f),s=0;s<e.length;s++)l[s]=e[s];for(r=0;r<c.length;r++){for(a=c[r],s=0;s<a.length;s++)l[i+s]=a[s];i+=s}return l},r.maxRowLength=function(t){return s(t,Math.max,0)},r.minRowLength=function(t){return s(t,Math.min,1/0)}},{}],220:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(i,"")),n(t)?Number(t):a}},{"../constants/numerical":212,"fast-isnumeric":23}],221:[function(t,e,r){"use strict";e.exports=function(t){var e=t._fullLayout;e._glcanvas&&e._glcanvas.size()&&e._glcanvas.each((function(t){t.regl&&t.regl.clear({color:!0,depth:!0})}))}},{}],222:[function(t,e,r){"use strict";e.exports=function(t){t._responsiveChartHandler&&(window.removeEventListener("resize",t._responsiveChartHandler),delete t._responsiveChartHandler)}},{}],223:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../plots/attributes"),o=t("../components/colorscale/scales"),l=t("../constants/interactions").DESELECTDIM,s=t("./nested_property"),c=t("./regex").counter,u=t("./mod").modHalf,f=t("./array").isArrayOrTypedArray;function d(t,e){var n=r.valObjectMeta[e.valType];if(e.arrayOk&&f(t))return!0;if(n.validateFunction)return n.validateFunction(t,e);var a={},i=a,o={set:function(t){i=t}};return n.coerceFunction(t,o,a,e),i!==a}r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){f(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;n<r.length;n++){var a=String(r[n]);if("/"===a.charAt(0)&&"/"===a.charAt(a.length-1)){if(new RegExp(a.substr(1,a.length-2)).test(t))return!0}else if(t===r[n])return!0}return!1}},boolean:{coerceFunction:function(t,e,r){!0===t||!1===t?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,a){!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return a(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(u(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||c(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!c(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i<a.length;){var o=a[i];-1===n.flags.indexOf(o)||a.indexOf(o)<i?a.splice(i,1):i++}a.length?e.set(a.join("+")):e.set(r)}else e.set(t);else e.set(r)}},any:{coerceFunction:function(t,e,r){void 0===t?e.set(r):e.set(t)}},info_array:{coerceFunction:function(t,e,n,a){function i(t,e,n){var a,i={set:function(t){a=t}};return void 0===n&&(n=e.dflt),r.valObjectMeta[e.valType].coerceFunction(t,i,n,e),a}var o=2===a.dimensions||"1-2"===a.dimensions&&Array.isArray(t)&&Array.isArray(t[0]);if(Array.isArray(t)){var l,s,c,u,f,d,p=a.items,h=[],g=Array.isArray(p),v=g&&o&&Array.isArray(p[0]),m=o&&g&&!v,y=g&&!m?p.length:t.length;if(n=Array.isArray(n)?n:[],o)for(l=0;l<y;l++)for(h[l]=[],c=Array.isArray(t[l])?t[l]:[],f=m?p.length:g?p[l].length:c.length,s=0;s<f;s++)u=m?p[s]:g?p[l][s]:p,void 0!==(d=i(c[s],u,(n[l]||[])[s]))&&(h[l][s]=d);else for(l=0;l<y;l++)void 0!==(d=i(t[l],g?p[l]:p,n[l]))&&(h[l]=d);e.set(h)}else e.set(n)},validateFunction:function(t,e){if(!Array.isArray(t))return!1;var r=e.items,n=Array.isArray(r),a=2===e.dimensions;if(!e.freeLength&&t.length!==r.length)return!1;for(var i=0;i<t.length;i++)if(a){if(!Array.isArray(t[i])||!e.freeLength&&t[i].length!==r[i].length)return!1;for(var o=0;o<t[i].length;o++)if(!d(t[i][o],n?r[i][o]:r))return!1}else if(!d(t[i],n?r[i]:r))return!1;return!0}}},r.coerce=function(t,e,n,a,i){var o=s(n,a).get(),l=s(t,a),c=s(e,a),u=l.get(),p=e._template;if(void 0===u&&p&&(u=s(p,a).get(),p=0),void 0===i&&(i=o.dflt),o.arrayOk&&f(u))return c.set(u),u;var h=r.valObjectMeta[o.valType].coerceFunction;h(u,c,i,o);var g=c.get();return p&&g===i&&!d(u,o)&&(h(u=s(p,a).get(),c,i,o),g=c.get()),g},r.coerce2=function(t,e,n,a,i){var o=s(t,a),l=r.coerce(t,e,n,a,i),c=o.get();return null!=c&&l},r.coerceFont=function(t,e,r){var n={};return r=r||{},n.family=t(e+".family",r.family),n.size=t(e+".size",r.size),n.color=t(e+".color",r.color),n},r.coerceHoverinfo=function(t,e,n){var a,o=e._module.attributes,l=o.hoverinfo?o:i,s=l.hoverinfo;if(1===n._dataLength){var c="all"===s.dflt?s.flags.slice():s.dflt.split("+");c.splice(c.indexOf("name"),1),a=c.join("+")}return r.coerce(t,e,l,"hoverinfo",a)},r.coerceSelectionMarkerOpacity=function(t,e){if(t.marker){var r,n,a=t.marker.opacity;if(void 0!==a)f(a)||t.selected||t.unselected||(r=a,n=l*a),e("selected.marker.opacity",r),e("unselected.marker.opacity",n)}},r.validate=d},{"../components/colorscale/scales":120,"../constants/interactions":211,"../plots/attributes":275,"./array":219,"./mod":240,"./nested_property":241,"./regex":249,"fast-isnumeric":23,tinycolor2:88}],224:[function(t,e,r){"use strict";var n,a,i=t("d3-time-format").timeFormat,o=t("fast-isnumeric"),l=t("./loggers"),s=t("./mod").mod,c=t("../constants/numerical"),u=c.BADNUM,f=c.ONEDAY,d=c.ONEHOUR,p=c.ONEMIN,h=c.ONESEC,g=c.EPOCHJD,v=t("../registry"),m=t("d3-time-format").utcFormat,y=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,x=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,b=(new Date).getFullYear()-70;function _(t){return t&&v.componentsRegistry.calendars&&"string"==typeof t&&"gregorian"!==t}function w(t,e){return String(t+Math.pow(10,e)).substr(1)}r.dateTick0=function(t,e){var n=function(t,e){return _(t)?e?v.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:v.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"}(t,!!e);if(e<2)return n;var a=r.dateTime2ms(n,t);return a+=f*(e-1),r.ms2DateTime(a,0,t)},r.dfltRange=function(t){return _(t)?v.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime},r.dateTime2ms=function(t,e){if(r.isJSDate(t)){var i=t.getTimezoneOffset()*p,o=(t.getUTCMinutes()-t.getMinutes())*p+(t.getUTCSeconds()-t.getSeconds())*h+(t.getUTCMilliseconds()-t.getMilliseconds());if(o){var l=3*p;i=i-l/2+s(o-i+l/2,l)}return(t=Number(t)-i)>=n&&t<=a?t:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=_(e),m=t.charAt(0);!c||"G"!==m&&"g"!==m||(t=t.substr(1),e="");var w=c&&"chinese"===e.substr(0,7),T=t.match(w?x:y);if(!T)return u;var k=T[1],M=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),C=Number(T[11]||0);if(c){if(2===k.length)return u;var O;k=Number(k);try{var D=v.getComponentMethod("calendars","getCal")(e);if(w){var z="i"===M.charAt(M.length-1);M=parseInt(M,10),O=D.newDate(k,D.toMonthIndex(k,M,z),A)}else O=D.newDate(k,Number(M),A)}catch(t){return u}return O?(O.toJD()-g)*f+L*d+S*p+C*h:u}k=2===k.length?(Number(k)+2e3-b)%100+b:Number(k),M-=1;var P=new Date(Date.UTC(2e3,M,A,L,S));return P.setUTCFullYear(k),P.getUTCMonth()!==M||P.getUTCDate()!==A?u:P.getTime()+C*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var T=90*f,k=3*d,M=5*p;function A(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return u;e||(e=0);var i,o,l,c,y,x,b=Math.floor(10*s(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(s(t,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(t){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e<T?Math.floor(S/d):0,l=e<T?Math.floor(S%d/p):0,c=e<k?Math.floor(S%p/h):0,y=e<M?S%h*10+b:0}else x=new Date(w),i=m("%Y-%m-%d")(x),o=e<T?x.getUTCHours():0,l=e<T?x.getUTCMinutes():0,c=e<k?x.getUTCSeconds():0,y=e<M?10*x.getUTCMilliseconds()+b:0;return A(i,o,l,c,y)},r.ms2DateTimeLocal=function(t){if(!(t>=n+f&&t<=a-f))return u;var e=Math.floor(10*s(t+.05,1)),r=new Date(Math.round(t-e/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===u)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return l.error("unrecognized date",t),e;return t};var L=/%\d?f/g;function S(t,e,r,n){t=t.replace(L,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(e+.05));if(_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=_(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=s(t+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(s(t/h,60),C[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+S(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return S(e,t,n,a)};var O=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=s(t,f);if(t=Math.round(t-n),r)try{var a=Math.round(t/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){l.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+O);return c.setUTCMonth(c.getUTCMonth()+e)+n-O},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,l=0,s=0,c=_(e)&&v.getComponentMethod("calendars","getCal")(e),u=0;u<t.length;u++)if(n=t[u],o(n)){if(!(n%f))if(c)try{1===(r=c.fromJD(n/f+g)).day()?1===r.month()?a++:i++:l++}catch(t){}else 1===(r=new Date(n)).getUTCDate()?0===r.getUTCMonth()?a++:i++:l++}else s++;l+=i+=a;var d=t.length-s;return{exactYears:a/d,exactMonths:i/d,exactDays:l/d}}},{"../constants/numerical":212,"../registry":326,"./loggers":237,"./mod":240,"d3-time-format":19,"fast-isnumeric":23}],225:[function(t,e,r){"use strict";var n=t("d3"),a=t("./loggers"),i=t("./matrix"),o=t("gl-mat4");function l(t){var e=t&&t.parentNode;e&&e.removeChild(t)}function s(t,e,r){var n="plotly.js-style-"+t,i=document.getElementById(n);i||((i=document.createElement("style")).setAttribute("id",n),i.appendChild(document.createTextNode("")),document.head.appendChild(i));var o=i.sheet;o.insertRule?o.insertRule(e+"{"+r+"}",0):o.addRule?o.addRule(e,r,0):a.warn("addStyleRule failed")}function c(t){var e=window.getComputedStyle(t,null),r=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("-moz-transform")||e.getPropertyValue("-ms-transform")||e.getPropertyValue("-o-transform")||e.getPropertyValue("transform");return"none"===r?null:r.replace("matrix","").replace("3d","").slice(1,-1).split(",").map((function(t){return+t}))}function u(t){for(var e=[];f(t);)e.push(t),t=t.parentNode;return e}function f(t){return t&&(t instanceof Element||t instanceof HTMLElement)}e.exports={getGraphDiv:function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null==t)throw new Error("DOM element provided is null or undefined");return t},isPlotDiv:function(t){var e=n.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},removeElement:l,addStyleRule:function(t,e){s("global",t,e)},addRelatedStyleRule:s,deleteRelatedStyleRule:function(t){var e="plotly.js-style-"+t,r=document.getElementById(e);r&&l(r)},getFullTransformMatrix:function(t){var e=u(t),r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return e.forEach((function(t){var e=c(t);if(e){var n=i.convertCssMatrix(e);r=o.multiply(r,r,n)}})),r},getElementTransformMatrix:c,getElementAndAncestors:u,equalDomRects:function(t,e){return t&&e&&t.x===e.x&&t.y===e.y&&t.top===e.top&&t.left===e.left&&t.right===e.right&&t.bottom===e.bottom}}},{"./loggers":237,"./matrix":239,d3:21,"gl-mat4":39}],226:[function(t,e,r){"use strict";var n=t("events").EventEmitter,a={init:function(t){if(t._ev instanceof n)return t;var e=new n,r=new n;return t._ev=e,t._internalEv=r,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=r.on.bind(r),t._internalOnce=r.once.bind(r),t._removeInternalListener=r.removeListener.bind(r),t._removeAllInternalListeners=r.removeAllListeners.bind(r),t.emit=function(n,a){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,a),e.emit(n,a),r.emit(n,a)},t},triggerHandler:function(t,e,r){var n,a;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var i=t._ev;if(!i)return n;var o,l=i._events[e];if(!l)return n;function s(t){return t.listener?(i.removeListener(e,t.listener),t.fired?void 0:(t.fired=!0,t.listener.apply(i,[r]))):t.apply(i,[r])}for(l=Array.isArray(l)?l:[l],o=0;o<l.length-1;o++)s(l[o]);return a=s(l[o]),void 0!==n?n:a},purge:function(t){return delete t._ev,delete t.on,delete t.once,delete t.removeListener,delete t.removeAllListeners,delete t.emit,delete t._ev,delete t._internalEv,delete t._internalOn,delete t._internalOnce,delete t._removeInternalListener,delete t._removeAllInternalListeners,t}};e.exports=a},{events:17}],227:[function(t,e,r){"use strict";var n=t("./is_plain_object.js"),a=Array.isArray;function i(t,e,r,o){var l,s,c,u,f,d,p=t[0],h=t.length;if(2===h&&a(p)&&a(t[1])&&0===p.length){if(function(t,e){var r,n;for(r=0;r<t.length;r++){if(null!==(n=t[r])&&"object"==typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}(t[1],p))return p;p.splice(0,p.length)}for(var g=1;g<h;g++)for(s in l=t[g])c=p[s],u=l[s],o&&a(u)?p[s]=u:e&&u&&(n(u)||(f=a(u)))?(f?(f=!1,d=c&&a(c)?c:[]):d=c&&n(c)?c:{},p[s]=i([d,u],e,r,o)):("undefined"!=typeof u||r)&&(p[s]=u);return p}r.extendFlat=function(){return i(arguments,!1,!1,!1)},r.extendDeep=function(){return i(arguments,!0,!1,!1)},r.extendDeepAll=function(){return i(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return i(arguments,!0,!1,!0)}},{"./is_plain_object.js":234}],228:[function(t,e,r){"use strict";e.exports=function(t){for(var e={},r=[],n=0,a=0;a<t.length;a++){var i=t[a];1!==e[i]&&(e[i]=1,r[n++]=i)}return r}},{}],229:[function(t,e,r){"use strict";function n(t){return!0===t.visible}function a(t){var e=t[0].trace;return!0===e.visible&&0!==e._length}e.exports=function(t){for(var e,r=(e=t,Array.isArray(e)&&Array.isArray(e[0])&&e[0][0]&&e[0][0].trace?a:n),i=[],o=0;o<t.length;o++){var l=t[o];r(l)&&i.push(l)}return i}},{}],230:[function(t,e,r){"use strict";var n,a,i,o=t("./mod").mod;function l(t,e,r,n,a,i,o,l){var s=r-t,c=a-t,u=o-a,f=n-e,d=i-e,p=l-i,h=s*p-u*f;if(0===h)return null;var g=(c*p-u*d)/h,v=(c*f-s*d)/h;return v<0||v>1||g<0||g>1?null:{x:t+s*g,y:e+f*g}}function s(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,l=a-e;return o*o+l*l}var s=n*e-a*t;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(t,e,r,n,a,i,o,c){if(l(t,e,r,n,a,i,o,c))return 0;var u=r-t,f=n-e,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-t,i-e),s(u,f,h,o-t,c-e),s(d,p,g,t-a,e-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,l){if(t===a&&l===i||(n={},a=t,i=l),n[r])return n[r];var s=t.getPointAtLength(o(r-l/2,e)),c=t.getPointAtLength(o(r+l/2,e)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=t.getPointAtLength(o(r,e)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,l=e.top,s=e.bottom,c=0,u=t.getTotalLength(),f=u;function d(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(a=r);var c=r.x<i?i-r.x:r.x>o?r.x-o:0,f=r.y<l?l-r.y:r.y>s?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,l=(n=n||{}).pathLength||t.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f<c;){if(a=(d+p)/2,o=(i=t.getPointAtLength(a))[r]-e,Math.abs(o)<s)return i;u*o>0?p=a:d=a,f++}return i}},{"./mod":240}],231:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],232:[function(t,e,r){"use strict";e.exports=function(t,e){if(!e)return t;var r=1/Math.abs(e),n=r>1?(r*t+r*e)/r:t+e,a=String(n).length;if(a>16){var i=String(e).length;if(a>=String(t).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],233:[function(t,e,r){"use strict";var n=t("d3"),a=t("d3-time-format").utcFormat,i=t("fast-isnumeric"),o=t("../constants/numerical"),l=o.FP_SAFE,s=o.BADNUM,c=e.exports={};c.nestedProperty=t("./nested_property"),c.keyedContainer=t("./keyed_container"),c.relativeAttr=t("./relative_attr"),c.isPlainObject=t("./is_plain_object"),c.toLogRange=t("./to_log_range"),c.relinkPrivateKeys=t("./relink_private");var u=t("./array");c.isTypedArray=u.isTypedArray,c.isArrayOrTypedArray=u.isArrayOrTypedArray,c.isArray1D=u.isArray1D,c.ensureArray=u.ensureArray,c.concat=u.concat,c.maxRowLength=u.maxRowLength,c.minRowLength=u.minRowLength;var f=t("./mod");c.mod=f.mod,c.modHalf=f.modHalf;var d=t("./coerce");c.valObjectMeta=d.valObjectMeta,c.coerce=d.coerce,c.coerce2=d.coerce2,c.coerceFont=d.coerceFont,c.coerceHoverinfo=d.coerceHoverinfo,c.coerceSelectionMarkerOpacity=d.coerceSelectionMarkerOpacity,c.validate=d.validate;var p=t("./dates");c.dateTime2ms=p.dateTime2ms,c.isDateTime=p.isDateTime,c.ms2DateTime=p.ms2DateTime,c.ms2DateTimeLocal=p.ms2DateTimeLocal,c.cleanDate=p.cleanDate,c.isJSDate=p.isJSDate,c.formatDate=p.formatDate,c.incrementMonth=p.incrementMonth,c.dateTick0=p.dateTick0,c.dfltRange=p.dfltRange,c.findExactDates=p.findExactDates,c.MIN_MS=p.MIN_MS,c.MAX_MS=p.MAX_MS;var h=t("./search");c.findBin=h.findBin,c.sorterAsc=h.sorterAsc,c.sorterDes=h.sorterDes,c.distinctVals=h.distinctVals,c.roundUp=h.roundUp,c.sort=h.sort,c.findIndexOfMin=h.findIndexOfMin;var g=t("./stats");c.aggNums=g.aggNums,c.len=g.len,c.mean=g.mean,c.median=g.median,c.midRange=g.midRange,c.variance=g.variance,c.stdev=g.stdev,c.interp=g.interp;var v=t("./matrix");c.init2dArray=v.init2dArray,c.transposeRagged=v.transposeRagged,c.dot=v.dot,c.translationMatrix=v.translationMatrix,c.rotationMatrix=v.rotationMatrix,c.rotationXYMatrix=v.rotationXYMatrix,c.apply3DTransform=v.apply3DTransform,c.apply2DTransform=v.apply2DTransform,c.apply2DTransform2=v.apply2DTransform2,c.convertCssMatrix=v.convertCssMatrix,c.inverseTransformMatrix=v.inverseTransformMatrix;var m=t("./angles");c.deg2rad=m.deg2rad,c.rad2deg=m.rad2deg,c.angleDelta=m.angleDelta,c.angleDist=m.angleDist,c.isFullCircle=m.isFullCircle,c.isAngleInsideSector=m.isAngleInsideSector,c.isPtInsideSector=m.isPtInsideSector,c.pathArc=m.pathArc,c.pathSector=m.pathSector,c.pathAnnulus=m.pathAnnulus;var y=t("./anchor_utils");c.isLeftAnchor=y.isLeftAnchor,c.isCenterAnchor=y.isCenterAnchor,c.isRightAnchor=y.isRightAnchor,c.isTopAnchor=y.isTopAnchor,c.isMiddleAnchor=y.isMiddleAnchor,c.isBottomAnchor=y.isBottomAnchor;var x=t("./geometry2d");c.segmentsIntersect=x.segmentsIntersect,c.segmentDistance=x.segmentDistance,c.getTextLocation=x.getTextLocation,c.clearLocationCache=x.clearLocationCache,c.getVisibleSegment=x.getVisibleSegment,c.findPointOnPath=x.findPointOnPath;var b=t("./extend");c.extendFlat=b.extendFlat,c.extendDeep=b.extendDeep,c.extendDeepAll=b.extendDeepAll,c.extendDeepNoArrays=b.extendDeepNoArrays;var _=t("./loggers");c.log=_.log,c.warn=_.warn,c.error=_.error;var w=t("./regex");c.counterRegex=w.counter;var T=t("./throttle");c.throttle=T.throttle,c.throttleDone=T.done,c.clearThrottle=T.clear;var k=t("./dom");function M(t){var e={};for(var r in t)for(var n=t[r],a=0;a<n.length;a++)e[n[a]]=+r;return e}c.getGraphDiv=k.getGraphDiv,c.isPlotDiv=k.isPlotDiv,c.removeElement=k.removeElement,c.addStyleRule=k.addStyleRule,c.addRelatedStyleRule=k.addRelatedStyleRule,c.deleteRelatedStyleRule=k.deleteRelatedStyleRule,c.getFullTransformMatrix=k.getFullTransformMatrix,c.getElementTransformMatrix=k.getElementTransformMatrix,c.getElementAndAncestors=k.getElementAndAncestors,c.equalDomRects=k.equalDomRects,c.clearResponsive=t("./clear_responsive"),c.preserveDrawingBuffer=t("./preserve_drawing_buffer"),c.makeTraceGroups=t("./make_trace_groups"),c._=t("./localize"),c.notifier=t("./notifier"),c.filterUnique=t("./filter_unique"),c.filterVisible=t("./filter_visible"),c.pushUnique=t("./push_unique"),c.increment=t("./increment"),c.cleanNumber=t("./clean_number"),c.ensureNumber=function(t){return i(t)?(t=Number(t))<-l||t>l?s:i(t)?Number(t):s:s},c.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(i(t)&&t>=0&&t%1==0)},c.noop=t("./noop"),c.identity=t("./identity"),c.repeat=function(t,e){for(var r=new Array(e),n=0;n<e;n++)r[n]=t;return r},c.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var a=0;a<e.length;a++){var i=e[a],o=c.nestedProperty(t,i.replace("?",r)),l=c.nestedProperty(t,i.replace("?",n)),s=o.get();o.set(l.get()),l.set(s)}},c.raiseToTop=function(t){t.parentNode.appendChild(t)},c.cancelTransition=function(t){return t.transition().duration(0)},c.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},c.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},c.simpleMap=function(t,e,r,n,a){for(var i=t.length,o=new Array(i),l=0;l<i;l++)o[l]=e(t[l],r,n,a);return o},c.randstr=function t(e,r,n,a){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var i,o,l=Math.log(Math.pow(2,r))/Math.log(n),s="";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++)s=Math.floor(Math.random()*n).toString(n)+s;u&&(o=Math.pow(n,u),s=Math.floor(Math.random()*o).toString(n)+s);var f=parseInt(s,n);return e&&e[s]||f!==1/0&&f>=Math.pow(2,r)?a>10?(c.warn("randstr failed uniqueness"),s):t(e,r,n,(a||0)+1):s},c.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},c.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,l=2*o,s=2*e-1,c=new Array(s),u=new Array(o);for(r=0;r<s;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<o;r++){for(i=0,n=0;n<s;n++)(a=r+n+1-e)<-o?a-=l*Math.round(a/l):a>=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=t[a]*c[n];u[r]=i}return u},c.syncOrAsync=function(t,e,r){var n;function a(){return c.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a).then(void 0,c.promiseError);return r&&r(e)},c.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},c.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n<r.length;n++)null!=t[r[n]]?a=!0:i=!1;if(a&&!i)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},c.mergeArray=function(t,e,r,n){var a="function"==typeof n;if(c.isArrayOrTypedArray(t))for(var i=Math.min(t.length,e.length),o=0;o<i;o++){var l=t[o];e[o][r]=a?n(l):l}},c.mergeArrayCastPositive=function(t,e,r){return c.mergeArray(t,e,r,(function(t){var e=+t;return isFinite(e)&&e>0?e:0}))},c.fillArray=function(t,e,r,n){if(n=n||c.identity,c.isArrayOrTypedArray(t))for(var a=0;a<e.length;a++)e[a][r]=n(t[a])},c.castOption=function(t,e,r,n){n=n||c.identity;var a=c.nestedProperty(t,r).get();return c.isArrayOrTypedArray(a)?Array.isArray(e)&&c.isArrayOrTypedArray(a[e[0]])?n(a[e[0]][e[1]]):n(a[e]):a},c.extractOption=function(t,e,r,n){if(r in t)return t[r];var a=c.nestedProperty(e,n).get();return Array.isArray(a)?void 0:a},c.tagSelected=function(t,e,r){var n,a,i=e.selectedpoints,o=e._indexToPoints;o&&(n=M(o));for(var l=0;l<i.length;l++){var s=i[l];if(c.isIndex(s)||c.isArrayOrTypedArray(s)&&c.isIndex(s[0])&&c.isIndex(s[1])){var u=n?n[s]:s,f=r?r[u]:u;void 0!==(a=f)&&a<t.length&&(t[f].selected=1)}}},c.selIndices2selPoints=function(t){var e=t.selectedpoints,r=t._indexToPoints;if(r){for(var n=M(r),a=[],i=0;i<e.length;i++){var o=e[i];if(c.isIndex(o)){var l=n[o];c.isIndex(l)&&a.push(l)}}return a}return e},c.getTargetArray=function(t,e){var r=e.target;if("string"==typeof r&&r){var n=c.nestedProperty(t,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},c.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,a,i,o=Object.keys(t);for(n=0;n<o.length;n++)i=t[a=o[n]],"_"!==a.charAt(0)&&"function"!=typeof i&&("module"===a?r[a]=i:Array.isArray(i)?r[a]="colorscale"===a?i.slice():i.slice(0,3):c.isTypedArray(i)?r[a]=i.subarray(0,3):r[a]=i&&"object"==typeof i?c.minExtend(t[a],e[a]):i);for(o=Object.keys(e),n=0;n<o.length;n++)"object"==typeof(i=e[a=o[n]])&&a in r&&"object"==typeof r[a]||(r[a]=i);return r},c.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},c.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r]))return!0;return!1},c.isIE=function(){return"undefined"!=typeof window.navigator.msSaveBlob};var A=/MSIE [1-9]\./;c.isIE9orBelow=function(){return c.isIE()&&A.test(window.navigator.userAgent)};var L=/Version\/[\d\.]+.*Safari/;c.isSafari=function(){return L.test(window.navigator.userAgent)};var S=/iPad|iPhone|iPod/;c.isIOS=function(){return S.test(window.navigator.userAgent)},c.isD3Selection=function(t){return t&&"function"==typeof t.classed},c.ensureSingle=function(t,e,r,n){var a=t.select(e+(r?"."+r:""));if(a.size())return a;var i=t.append(e);return r&&i.classed(r,!0),n&&i.call(n),i},c.ensureSingleById=function(t,e,r,n){var a=t.select(e+"#"+r);if(a.size())return a;var i=t.append(e).attr("id",r);return n&&i.call(n),i},c.objectFromPath=function(t,e){for(var r,n=t.split("."),a=r={},i=0;i<n.length;i++){var o=n[i],l=null,s=n[i].match(/(.*)\[([0-9]+)\]/);s?(o=s[1],l=s[2],r=r[o]=[],i===n.length-1?r[l]=e:r[l]={},r=r[l]):(i===n.length-1?r[o]=e:r[o]={},r=r[o])}return a};var C=/^([^\[\.]+)\.(.+)?/,O=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;c.expandObjectPaths=function(t){var e,r,n,a,i,o,l;if("object"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(C))?(a=t[r],n=e[1],delete t[r],t[n]=c.extendDeepNoArrays(t[n]||{},c.objectFromPath(r,c.expandObjectPaths(a))[n])):(e=r.match(O))?(a=t[r],n=e[1],i=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3]?(l=e[4],o=t[n][i]=t[n][i]||{},c.extendDeepNoArrays(o,c.objectFromPath(l,c.expandObjectPaths(a)))):t[n][i]=c.expandObjectPaths(a)):t[r]=c.expandObjectPaths(t[r]));return t},c.numSeparate=function(t,e,r){if(r||(r=!1),"string"!=typeof e||0===e.length)throw new Error("Separator string required for formatting!");"number"==typeof t&&(t=String(t));var n=/(\d+)(\d{3})/,a=e.charAt(0),i=e.charAt(1),o=t.split("."),l=o[0],s=o.length>1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},c.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var D=/^\w*$/;c.templateString=function(t,e){var r={};return t.replace(c.TEMPLATE_STRING_REGEX,(function(t,n){var a;return D.test(n)?a=e[n]:(r[n]=r[n]||c.nestedProperty(e,n).get,a=r[n]()),c.isValidTextValue(a)?a:""}))};var z={max:10,count:0,name:"hovertemplate"};c.hovertemplateString=function(){return I.apply(z,arguments)};var P={max:10,count:0,name:"texttemplate"};c.texttemplateString=function(){return I.apply(P,arguments)};var E=/^[:|\|]/;function I(t,e,r){var i=this,o=arguments;e||(e={});var l={};return t.replace(c.TEMPLATE_STRING_REGEX,(function(t,s,u){var f,d,p,h;for(p=3;p<o.length;p++)if(f=o[p]){if(f.hasOwnProperty(s)){d=f[s];break}if(D.test(s)||(d=l[s]||c.nestedProperty(f,s).get())&&(l[s]=d),void 0!==d)break}if(void 0===d&&i)return i.count<i.max&&(c.warn("Variable '"+s+"' in "+i.name+" could not be found!"),d=t),i.count===i.max&&c.warn("Too many "+i.name+" warnings - additional warnings will be suppressed"),i.count++,t;if(u){if(":"===u[0]&&(d=(h=r?r.numberFormat:n.format)(u.replace(E,""))(d)),"|"===u[0]){h=r?r.timeFormat:a;var g=c.dateTime2ms(d);d=c.formatDate(g,u.replace(E,""),!1,h)}}else e.hasOwnProperty(s+"Label")&&(d=e[s+"Label"]);return d}))}c.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,a=0,i=0;i<r;i++){var o=t.charCodeAt(i)||0,l=e.charCodeAt(i)||0,s=o>=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var R=2e9;c.seedPseudoRandom=function(){R=2e9},c.pseudoRandom=function(){var t=R;return R=(69069*R+1)%4294967296,Math.abs(R-t)<429496729?c.pseudoRandom():R/4294967296},c.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=c.extractOption(t,e,"htx","hovertext");if(c.isValidTextValue(a))return n(a);var i=c.extractOption(t,e,"tx","text");return c.isValidTextValue(i)?n(i):void 0},c.isValidTextValue=function(t){return t||0===t},c.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n<e;n++)-1!==r.indexOf(".")&&(r=(r=r.replace("0%","%")).replace(".%","%"));return r},c.isHidden=function(t){var e=window.getComputedStyle(t).display;return!e||"none"===e},c.strTranslate=function(t,e){return t||e?"translate("+t+","+e+")":""},c.strRotate=function(t){return t?"rotate("+t+")":""},c.strScale=function(t){return 1!==t?"scale("+t+")":""},c.getTextTransform=function(t){var e=t.noCenter,r=t.textX,n=t.textY,a=t.targetX,i=t.targetY,o=t.anchorX||0,l=t.anchorY||0,s=t.rotate,u=t.scale;return u?u>1&&(u=1):u=0,c.strTranslate(a-u*(r+o),i-u*(n+l))+c.strScale(u)+(s?"rotate("+s+(e?"":" "+r+" "+n)+")":"")},c.ensureUniformFontSize=function(t,e){var r=c.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},c.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)}},{"../constants/numerical":212,"./anchor_utils":217,"./angles":218,"./array":219,"./clean_number":220,"./clear_responsive":222,"./coerce":223,"./dates":224,"./dom":225,"./extend":227,"./filter_unique":228,"./filter_visible":229,"./geometry2d":230,"./identity":231,"./increment":232,"./is_plain_object":234,"./keyed_container":235,"./localize":236,"./loggers":237,"./make_trace_groups":238,"./matrix":239,"./mod":240,"./nested_property":241,"./noop":242,"./notifier":243,"./preserve_drawing_buffer":246,"./push_unique":247,"./regex":249,"./relative_attr":250,"./relink_private":251,"./search":252,"./stats":254,"./throttle":256,"./to_log_range":257,d3:21,"d3-time-format":19,"fast-isnumeric":23}],234:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],235:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};e&&e.length?(s=n(t,e),l=s.get()):l=t,e=e||"";var u={};if(l)for(o=0;o<l.length;o++)u[l[o][r]]=o;var f=a.test(i),d={set:function(t,e){var a=null===e?4:0;if(!l){if(!s||4===a)return;l=[],s.set(l)}var o=u[t];if(void 0===o){if(4===a)return;a|=3,o=l.length,u[t]=o}else e!==(f?l[o][i]:n(l[o],i).get())&&(a|=2);var p=l[o]=l[o]||{};return p[r]=t,f?p[i]=e:n(p,i).set(e),null!==e&&(a&=-5),c[o]=c[o]|a,d},get:function(t){if(l){var e=u[t];return void 0===e?void 0:f?l[e][i]:n(l[e],i).get()}},rename:function(t,e){var n=u[t];return void 0===n||(c[n]=1|c[n],u[e]=n,delete u[t],l[n][r]=e),d},remove:function(t){var e=u[t];if(void 0===e)return d;var a=l[e];if(Object.keys(a).length>2)return c[e]=2|c[e],d.set(t,null);if(f){for(o=e;o<l.length;o++)c[o]=3|c[o];for(o=e;o<l.length;o++)u[l[o][r]]--;l.splice(e,1),delete u[t]}else n(a,i).set(null),c[e]=6|c[e];return d},constructUpdate:function(){for(var t,a,o={},s=Object.keys(c),u=0;u<s.length;u++)a=s[u],t=e+"["+a+"]",l[a]?(1&c[a]&&(o[t+"."+r]=l[a][r]),2&c[a]&&(o[t+"."+i]=f?4&c[a]?null:l[a][i]:4&c[a]?null:n(l[a],i).get())):o[t]=null;return o}};return d}},{"./nested_property":241}],236:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t,e){for(var r=t._context.locale,a=0;a<2;a++){for(var i=t._context.locales,o=0;o<2;o++){var l=(i[r]||{}).dictionary;if(l){var s=l[e];if(s)return s}i=n.localeRegistry}var c=r.split("-")[0];if(c===r)break;r=c}return e}},{"../registry":326}],237:[function(t,e,r){"use strict";var n=t("../plot_api/plot_config").dfltConfig,a=t("./notifier"),i=e.exports={};function o(t,e){if(t&&t.apply)try{return void t.apply(console,e)}catch(t){}for(var r=0;r<e.length;r++)try{t(e[r])}catch(t){console.log(e[r])}}i.log=function(){var t;if(n.logging>1){var e=["LOG:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);o(console.trace||console.log,e)}if(n.notifyOnLogging>1){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);a(r.join("<br>"),"long")}},i.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);o(console.trace||console.log,e)}if(n.notifyOnLogging>0){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);a(r.join("<br>"),"stick")}},i.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);o(console.error,e)}if(n.notifyOnLogging>0){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);a(r.join("<br>"),"stick")}}},{"../plot_api/plot_config":266,"./notifier":243}],238:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e,r){var a=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=t.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(t){t[0][i]=n.select(this)})),a}},{d3:21}],239:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;n<t;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,a=t.length;for(e=0;e<a;e++)n=Math.max(n,t[e].length);var i=new Array(n);for(e=0;e<n;e++)for(i[e]=new Array(a),r=0;r<a;r++)i[e][r]=t[r][e];return i},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,a,i=t.length;if(t[0].length)for(n=new Array(i),a=0;a<i;a++)n[a]=r.dot(t[a],e);else if(e[0].length){var o=r.transposeRagged(e);for(n=new Array(o.length),a=0;a<o.length;a++)n[a]=r.dot(t,o[a])}else for(n=0,a=0;a<i;a++)n+=t[a]*e[a];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply3DTransform=function(t){return function(){var e=arguments,n=1===arguments.length?e[0]:[e[0],e[1],e[2]||0];return r.dot(t,[n[0],n[1],n[2],1]).slice(0,3)}},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}},r.convertCssMatrix=function(t){if(t){var e=t.length;if(16===e)return t;if(6===e)return[t[0],t[1],0,0,t[2],t[3],0,0,0,0,1,0,t[4],t[5],0,1]}return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},r.inverseTransformMatrix=function(t){var e=[];return n.invert(e,t),[[e[0],e[1],e[2],e[3]],[e[4],e[5],e[6],e[7]],[e[8],e[9],e[10],e[11]],[e[12],e[13],e[14],e[15]]]}},{"gl-mat4":39}],240:[function(t,e,r){"use strict";e.exports={mod:function(t,e){var r=t%e;return r<0?r+e:r},modHalf:function(t,e){return Math.abs(t)>e/2?t-Math.round(t/e)*e:t}}},{}],241:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;function i(t,e){return function(){var r,n,o,l,s,c=t;for(l=0;l<e.length-1;l++){if(-1===(r=e[l])){for(n=!0,o=[],s=0;s<c.length;s++)o[s]=i(c[s],e.slice(l+1))(),o[s]!==o[0]&&(n=!1);return n?o[0]:o}if("number"==typeof r&&!a(c))return;if("object"!=typeof(c=c[r])||null===c)return}if("object"==typeof c&&null!==c&&null!==(o=c[e[l]]))return o}}e.exports=function(t,e){if(n(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,a,o,l=0,c=e.split(".");l<c.length;){if(r=String(c[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])c[l]=r[1];else{if(0!==l)throw"bad property string";c.splice(0,1)}for(a=r[2].substr(1,r[2].length-2).split("]["),o=0;o<a.length;o++)l++,c.splice(l,0,Number(a[o]))}l++}return"object"!=typeof t?function(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}(t,e,c):{set:s(t,c,e),get:i(t,c),astr:e,parts:c,obj:t}};var o=/(^|\.)args\[/;function l(t,e){return void 0===t||null===t&&!e.match(o)}function s(t,e,r){return function(n){var i,o,s=t,d="",p=[[t,d]],h=l(n,r);for(o=0;o<e.length-1;o++){if("number"==typeof(i=e[o])&&!a(s))throw"array index but container is not an array";if(-1===i){if(h=!u(s,e.slice(o+1),n,r))break;return}if(!f(s,i,e[o+1],h))break;if("object"!=typeof(s=s[i])||null===s)throw"container is not an object";d=c(d,i),p.push([s,d])}if(h){if(o===e.length-1&&(delete s[e[o]],Array.isArray(s)&&+e[o]==s.length-1))for(;s.length&&void 0===s[s.length-1];)s.pop()}else s[e[o]]=n}}function c(t,e){var r=e;return n(e)?r="["+e+"]":t&&(r="."+e),t+r}function u(t,e,r,n){var i,o=a(r),c=!0,u=r,d=n.replace("-1",0),p=!o&&l(r,d),h=e[0];for(i=0;i<t.length;i++)d=n.replace("-1",i),o&&(p=l(u=r[i%r.length],d)),p&&(c=!1),f(t,i,h,p)&&s(t[i],e,n.replace("-1",i))(u);return c}function f(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}},{"./array":219,"fast-isnumeric":23}],242:[function(t,e,r){"use strict";e.exports=function(){}},{}],243:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=[];e.exports=function(t,e){if(-1===i.indexOf(t)){i.push(t);var r=1e3;a(e)?r=e:"long"===e&&(r=3e3);var o=n.select("body").selectAll(".plotly-notifier").data([0]);o.enter().append("div").classed("plotly-notifier",!0),o.selectAll(".notifier-note").data(i).enter().append("div").classed("notifier-note",!0).style("opacity",0).each((function(t){var a=n.select(this);a.append("button").classed("notifier-close",!0).html("&times;").on("click",(function(){a.transition().call(l)}));for(var i=a.append("p"),o=t.split(/<br\s*\/?>/g),s=0;s<o.length;s++)s&&i.append("br"),i.append("span").text(o[s]);"stick"===e?a.transition().duration(350).style("opacity",1):a.transition().duration(700).style("opacity",1).transition().delay(r).call(l)}))}function l(t){t.duration(700).style("opacity",0).each("end",(function(t){var e=i.indexOf(t);-1!==e&&i.splice(e,1),n.select(this).remove()}))}}},{d3:21,"fast-isnumeric":23}],244:[function(t,e,r){"use strict";var n=t("./setcursor"),a="data-savedcursor";e.exports=function(t,e){var r=t.attr(a);if(e){if(!r){for(var i=(t.attr("class")||"").split(" "),o=0;o<i.length;o++){var l=i[o];0===l.indexOf("cursor-")&&t.attr(a,l.substr(7)).classed(l,!1)}t.attr(a)||t.attr(a,"!!")}n(t,e)}else r&&(t.attr(a,null),"!!"===r?n(t):n(t,r))}},{"./setcursor":253}],245:[function(t,e,r){"use strict";var n=t("./matrix").dot,a=t("../constants/numerical").BADNUM,i=e.exports={};i.tester=function(t){var e,r=t.slice(),n=r[0][0],i=n,o=r[0][1],l=o;for(r.push(r[0]),e=1;e<r.length;e++)n=Math.min(n,r[e][0]),i=Math.max(i,r[e][0]),o=Math.min(o,r[e][1]),l=Math.max(l,r[e][1]);var s,c=!1;5===r.length&&(r[0][0]===r[1][0]?r[2][0]===r[3][0]&&r[0][1]===r[3][1]&&r[1][1]===r[2][1]&&(c=!0,s=function(t){return t[0]===r[0][0]}):r[0][1]===r[1][1]&&r[2][1]===r[3][1]&&r[0][0]===r[3][0]&&r[1][0]===r[2][0]&&(c=!0,s=function(t){return t[1]===r[0][1]}));var u=!0,f=r[0];for(e=1;e<r.length;e++)if(f[0]!==r[e][0]||f[1]!==r[e][1]){u=!1;break}return{xmin:n,xmax:i,ymin:o,ymax:l,pts:r,contains:c?function(t,e){var r=t[0],c=t[1];return!(r===a||r<n||r>i||c===a||c<o||c>l)&&(!e||!s(t))}:function(t,e){var s=t[0],c=t[1];if(s===a||s<n||s>i||c===a||c<o||c>l)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;u<g;u++)if(f=v,d=m,v=r[u][0],m=r[u][1],!(s<(p=Math.min(f,v))||s>Math.max(f,v)||c>Math.max(d,m)))if(c<Math.min(d,m))s!==p&&y++;else{if(c===(h=v===f?c:d+(s-f)*(m-d)/(v-f)))return 1!==u||!e;c<=h&&s!==p&&y++}return y%2==1},isRect:c,degenerate:u}},i.isSegmentBent=function(t,e,r,a){var i,o,l,s=t[e],c=[t[r][0]-s[0],t[r][1]-s[1]],u=n(c,c),f=Math.sqrt(u),d=[-c[1]/f,c[0]/f];for(i=e+1;i<r;i++)if(o=[t[i][0]-s[0],t[i][1]-s[1]],(l=n(o,c))<0||l>u||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c<t.length;c++)(c===t.length-1||i.isSegmentBent(t,s,c+1,e))&&(r.push(t[c]),r.length<l-2&&(n=c,a=r.length-1),s=c)}t.length>1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":212,"./matrix":239}],246:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("is-mobile");e.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;"undefined"!=typeof navigator&&(t=navigator.userAgent);t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]);return t}()))return!0;var r=a({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var i=e.split(" "),o=1;o<i.length;o++){if(-1!==i[o].indexOf("Safari"))for(var l=o-1;l>-1;l--){var s=i[l];if("Version/"===s.substr(0,8)){var c=s.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":23,"is-mobile":74}],247:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;n<t.length;n++)if(t[n]instanceof RegExp&&t[n].toString()===r)return t;t.push(e)}else!e&&0!==e||-1!==t.indexOf(e)||t.push(e);return t}},{}],248:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plot_api/plot_config").dfltConfig;var i={add:function(t,e,r,n,i){var o,l;t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},l=t.undoQueue.index,t.autoplay?t.undoQueue.inSequence||(t.autoplay=!1):(!t.undoQueue.sequence||t.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(l,t.undoQueue.queue.length-l,o),t.undoQueue.index+=1):o=t.undoQueue.queue[l-1],t.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(e),o.undo.args.unshift(r),o.redo.calls.push(n),o.redo.args.push(i)),t.undoQueue.queue.length>a.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.undo.calls.length;r++)i.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},redo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.redo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)i.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}}};i.plotDo=function(t,e,r){t.autoplay=!0,r=function(t,e){for(var r,a=[],i=0;i<e.length;i++)r=e[i],a[i]=r===t?r:"object"==typeof r?Array.isArray(r)?n.extendDeep([],r):n.extendDeepAll({},r):r;return a}(t,r),e.apply(null,r)},e.exports=i},{"../lib":233,"../plot_api/plot_config":266}],249:[function(t,e,r){"use strict";r.counter=function(t,e,r,n){var a=(e||"")+(r?"":"$"),i=!1===n?"":"^";return"xy"===t?new RegExp(i+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+a):new RegExp(i+t+"([2-9]|[1-9][0-9]+)?"+a)}},{}],250:[function(t,e,r){"use strict";var n=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,a=/^[^\.\[\]]+$/;e.exports=function(t,e){for(;e;){var r=t.match(n);if(r)t=r[1];else{if(!t.match(a))throw new Error("bad relativeAttr call:"+[t,e]);t=""}if("^"!==e.charAt(0))break;e=e.slice(1)}return t&&"["!==e.charAt(0)?t+"."+e:t+e}},{}],251:[function(t,e,r){"use strict";var n=t("./array").isArrayOrTypedArray,a=t("./is_plain_object");e.exports=function t(e,r){for(var i in r){var o=r[i],l=e[i];if(l!==o)if("_"===i.charAt(0)||"function"==typeof o){if(i in e)continue;e[i]=o}else if(n(o)&&n(l)&&a(o[0])){if("customdata"===i||"ids"===i)continue;for(var s=Math.min(o.length,l.length),c=0;c<s;c++)l[c]!==o[c]&&a(o[c])&&a(l[c])&&t(l[c],o[c])}else a(o)&&a(l)&&(t(l,o),Object.keys(l).length||delete e[i])}}},{"./array":219,"./is_plain_object":234}],252:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./loggers"),i=t("./identity"),o=t("../constants/numerical").BADNUM;function l(t,e){return t<e}function s(t,e){return t<=e}function c(t,e){return t>e}function u(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,o,f=0,d=e.length,p=0,h=d>1?(e[d-1]-e[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,t+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f<d&&p++<100;)o(e[i=Math.floor((f+d)/2)],t)?f=i+1:d=i;return p>90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t,e){var n,a=(e||{}).unitMinDiff,i=t.slice();for(i.sort(r.sorterAsc),n=i.length-1;n>-1&&i[n]===o;n--);var l=1;a||(l=i[n]-i[0]||1);for(var s,c=l/(n||1)/1e4,u=[],f=0;f<=n;f++){var d=i[f],p=d-s;void 0===s?(u.push(d),s=d):p>c&&(l=Math.min(l,p),u.push(d),s=d)}return{vals:u,minDiff:l}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a<i&&o++<100;)e[n=c((a+i)/2)]<=t?a=n+l:i=n-s;return e[a]},r.sort=function(t,e){for(var r=0,n=0,a=1;a<t.length;a++){var i=e(t[a],t[a-1]);if(i<0?r=1:i>0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||i;for(var r,n=1/0,a=0;a<t.length;a++){var o=e(t[a]);o<n&&(n=o,r=a)}return r}},{"../constants/numerical":212,"./identity":231,"./loggers":237,"fast-isnumeric":23}],253:[function(t,e,r){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach((function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)})),e&&t.classed("cursor-"+e,!0)}},{}],254:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;r.aggNums=function(t,e,i,o){var l,s;if((!o||o>i.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(s=new Array(o),l=0;l<o;l++)s[l]=r.aggNums(t,e,i[l]);i=s}for(l=0;l<o;l++)n(e)?n(i[l])&&(e=t(+e,+i[l])):e=i[l];return e},r.len=function(t){return r.aggNums((function(t){return t+1}),0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums((function(t,e){return t+e}),0,t)/e},r.midRange=function(t){if(void 0!==t&&0!==t.length)return(r.aggNums(Math.max,null,t)+r.aggNums(Math.min,null,t))/2},r.variance=function(t,e,a){return e||(e=r.len(t)),n(a)||(a=r.mean(t,e)),r.aggNums((function(t,e){return t+Math.pow(e-a,2)}),0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.median=function(t){var e=t.slice().sort();return r.interp(e,.5)},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if((e=e*t.length-.5)<0)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":219,"fast-isnumeric":23}],255:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib"),i=a.strTranslate,o=t("../constants/xmlns_namespaces"),l=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,A){var L=t.text(),C=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&L.match(c),O=n.select(t.node().parentNode);if(!O.empty()){var D=t.attr("class")?t.attr("class").split(" ")[0]:"text";return D+="-math",O.selectAll("svg."+D).remove(),O.selectAll("g."+D+"-group").remove(),t.style("display",null).attr({"data-unformatted":L,"data-math":"N"}),C?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),o={fontSize:r};!function(t,e,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(f,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),e,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(C[2],o,(function(n,a,o){O.selectAll("svg."+D).remove(),O.selectAll("g."+D+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return z(),void e();var c=O.append("g").classed(D+"-group",!0).attr({"pointer-events":"none","data-unformatted":L,"data-math":"Y"});c.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild),l.attr({class:D,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black",f=l.select("g");f.attr({fill:u,stroke:u});var d=s(f,"width"),p=s(f,"height"),h=+t.attr("x")-d*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],g=-(r||s(t,"height"))/4;"y"===D[0]?(c.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+")"+i(-d/2,g-p/2)}),l.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===D[0]?l.attr({x:t.attr("x"),y:g-p/2}):"a"===D[0]&&0!==D.indexOf("atitle")?l.attr({x:0,y:g}):l.attr({x:h,y:+t.attr("y")+g-p/2}),A&&A.call(t,c),e(c)}))}))):z(),t}function z(){O.empty()||(D=t.attr("class")+"-math",O.select("svg."+D).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(v," ");var r,i=!1,s=[],c=-1;function u(){c++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:c*l+"em"}),t.appendChild(e),r=e;var a=s;if(s=[{node:e}],a.length>1)for(var i=1;i<a.length;i++)f(a[i])}function f(t){var e,a=t.type,i={};if("a"===a){e="a";var l=t.target,c=t.href,u=t.popup;c&&(i={"xlink:xlink:show":"_blank"===l||"_"!==l.charAt(0)?"new":"replace",target:l,"xlink:xlink:href":c},u&&(i.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+u+'");return false;'))}else e="tspan";t.style&&(i.style=t.style);var f=document.createElementNS(o.svg,e);if("sup"===a||"sub"===a){A(r,"\u200b"),r.appendChild(f);var d=document.createElementNS(o.svg,"tspan");A(d,"\u200b"),n.select(d).attr("dy",h[a]),i.dy=p[a],r.appendChild(f),r.appendChild(d)}else r.appendChild(f);n.select(f).attr(i),r=t.node=f,s.push(t)}function A(t,e){t.appendChild(document.createTextNode(e))}function L(t){if(1!==s.length){var n=s.pop();t!==n.type&&a.log("Start tag <"+n.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag </"+t+">.",e)}x.test(e)?u():(r=t,s=[{node:t}]);for(var C=e.split(m),O=0;O<C.length;O++){var D=C[O],z=D.match(y),P=z&&z[2].toLowerCase(),E=d[P];if("br"===P)u();else if(void 0===E)A(r,S(D));else if(z[1])L(P);else{var I=z[4],R={type:P},F=k(I,b);if(F?(F=F.replace(M,"$1 fill:"),E&&(F+=";"+E)):E&&(F=E),F&&(R.style=F),"a"===P){i=!0;var N=k(I,_);if(N){var B=document.createElement("a");B.href=N,-1!==g.indexOf(B.protocol)&&(R.href=encodeURI(decodeURI(N)),R.target=k(I,w)||"_blank",R.popup=k(I,T))}}f(R)}}return i}(t.node(),L)&&t.style("pointer-events","all"),r.positionText(t),A&&A.call(t)}};var u=/(<|&lt;|&#60;)/g,f=/(>|&gt;|&#62;)/g;var d={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"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},g=["http:","https:","mailto:","",void 0,":"],v=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=/<br(\s+.*)?>/i;r.BR_TAG_ALL=/<br(\s+.*)?>/gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var M=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],a="...".length,i=t.split(m),o=[],l="",s=0,c=0;c<i.length;c++){var u=i[c],f=u.match(y),d=f&&f[2].toLowerCase();if(d)-1!==n.indexOf(d)&&(o.push(u),l=d);else{var p=u.length;if(s+p<r)o.push(u),s+=p;else if(s<r){var h=r-s;l&&("br"!==l||h<=a||p<=a)&&o.pop(),r>a?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},L=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(t){return t.replace(L,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):A[e])||t}))}function C(t,e,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return c.bottom-n.height}:"middle"===s?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===l?function(){return c.right-n.width}:"center"===l?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var t=o()-u.left,e=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(t,e);t=s[0],e=s[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(t){t=t.replace(v," ");for(var e=document.createElement("p"),r=e,a=[],i=t.split(m),o=0;o<i.length;o++){var l=i[o],s=l.match(y),c=s&&s[2].toLowerCase();if(c in d)if(s[1])a.length&&(r=a.pop());else{var u=s[4],f=k(u,b),p=f?{style:f}:{};if("a"===c){var h=k(u,_);if(h){var x=document.createElement("a");if(x.href=h,-1!==g.indexOf(x.protocol)){p.href=encodeURI(decodeURI(h));var T=k(u,w);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(S(l)))}return e.innerHTML},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each((function(){var t=n.select(this);function a(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var i=a("x",e),o=a("y",r);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:i,y:o})}))},r.makeEditable=function(t,e){var r=e.gd,a=e.delegate,i=n.dispatch("edit","input","cancel"),o=a||t;if(t.style({"pointer-events":a?"none":"all"}),1!==t.size())throw new Error("boo");function l(){!function(){var a=n.select(r).select(".svg-container"),o=a.append("div"),l=t.node().style,c=parseFloat(l.fontSize||12),u=e.text;void 0===u&&(u=t.attr("data-unformatted"));o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":l.fontFamily||"Arial","font-size":c,color:e.fill||l.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(u).call(C(t,a,e)).on("blur",(function(){r._editing=!1,t.text(this.textContent).style({opacity:1});var e,a=n.select(this).attr("class");(e=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(e).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),i.edit.call(t,o)})).on("focus",(function(){var t=this;r._editing=!0,n.select(document).on("mouseup",(function(){if(n.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()}))})).on("keyup",(function(){27===n.event.which?(r._editing=!1,t.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",(function(){return!1})).transition().remove(),i.cancel.call(t,this.textContent)):(i.input.call(t,this.textContent),n.select(this).call(C(t,a,e)))})).on("keydown",(function(){13===n.event.which&&this.blur()})).call(s)}(),t.style({opacity:0});var a,l=o.attr("class");(a=l?"."+l.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(a).style({opacity:0})}function s(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return e.immediate?l():o.on("click",l),n.rebind(t,i,"on")}},{"../constants/alignment":207,"../constants/xmlns_namespaces":213,"../lib":233,d3:21}],256:[function(t,e,r){"use strict";var n={};function a(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}r.throttle=function(t,e,r){var i=n[t],o=Date.now();if(!i){for(var l in n)n[l].ts<o-6e4&&delete n[l];i=n[t]={ts:0,timer:null}}function s(){r(),i.ts=Date.now(),i.onDone&&(i.onDone(),i.onDone=null)}a(i),o>i.ts+e?s():i.timer=setTimeout((function(){s(),i.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],257:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":23}],258:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],259:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],260:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],l=0;l<i.length;l++)if((r=t.match(i[l]))&&0===r.index){e=r[0];break}if(e||(e=a[a.indexOf(o)]),!e)return!1;var s=t.substr(e.length);return s?!!(r=s.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:e,index:Number(r[1]),property:r[3]||""}:{array:e,index:"",property:""}}},{"../registry":326}],261:[function(t,e,r){"use strict";var n=t("../lib"),a=n.extendFlat,i=n.isPlainObject,o={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},l={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},s=o.flags.slice().concat(["fullReplot"]),c=l.flags.slice().concat("layoutReplot");function u(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!1;return e}function f(t,e,r){var n=a({},t);for(var o in n){var l=n[o];i(l)&&(n[o]=d(l,e,r,o))}return"from-root"===r&&(n.editType=e),n}function d(t,e,r,n){if(t.valType){var i=a({},t);if(i.editType=e,Array.isArray(t.items)){i.items=new Array(t.items.length);for(var o=0;o<t.items.length;o++)i.items[o]=d(t.items[o],e,"from-root")}return i}return f(t,e,"_"===n.charAt(0)?"nested":"from-root")}e.exports={traces:o,layout:l,traceFlags:function(){return u(s)},layoutFlags:function(){return u(c)},update:function(t,e){var r=e.editType;if(r&&"none"!==r)for(var n=r.split("+"),a=0;a<n.length;a++)t[n[a]]=!0},overrideAll:f}},{"../lib":233}],262:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("gl-mat4/fromQuat"),i=t("../registry"),o=t("../lib"),l=t("../plots/plots"),s=t("../plots/cartesian/axis_ids"),c=t("../components/color"),u=s.cleanId,f=s.getFromTrace,d=i.traceIs;function p(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=u(r,n,!0))}function h(t){function e(e,r){var n=t[e],a=t.title&&t.title[r];n&&!a&&(t.title||(t.title={}),t.title[r]=t[e],delete t[e])}t&&("string"!=typeof t.title&&"number"!=typeof t.title||(t.title={text:t.title}),e("titlefont","font"),e("titleposition","position"),e("titleside","side"),e("titleoffset","offset"))}function g(t){if(!o.isPlainObject(t))return!1;var e=t.name;return delete t.name,delete t.showlegend,("string"==typeof e||"number"==typeof e)&&String(e)}function v(t,e,r,n){if(r&&!n)return t;if(n&&!r)return e;if(!t.trim())return e;if(!e.trim())return t;var a,i=Math.min(t.length,e.length);for(a=0;a<i&&t.charAt(a)===e.charAt(a);a++);return t.substr(0,a).trim()}function m(t){var e="middle",r="center";return"string"==typeof t&&(-1!==t.indexOf("top")?e="top":-1!==t.indexOf("bottom")&&(e="bottom"),-1!==t.indexOf("left")?r="left":-1!==t.indexOf("right")&&(r="right")),e+" "+r}function y(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e<g.length;e++){var v=g[e];if(i&&i.test(v)){var m=t[v];m.anchor&&"free"!==m.anchor&&(m.anchor=u(m.anchor)),m.overlaying&&(m.overlaying=u(m.overlaying)),m.type||(m.isdate?m.type="date":m.islog?m.type="log":!1===m.isdate&&!1===m.islog&&(m.type="linear")),"withzero"!==m.autorange&&"tozero"!==m.autorange||(m.autorange=!0,m.rangemode="tozero"),delete m.islog,delete m.isdate,delete m.categories,y(m,"domain")&&delete m.domain,void 0!==m.autotick&&(void 0===m.tickmode&&(m.tickmode=m.autotick?"auto":"linear"),delete m.autotick),h(m)}else if(s&&s.test(v)){h(t[v].radialaxis)}else if(f&&f.test(v)){var x=t[v];h(x.aaxis),h(x.baxis),h(x.caxis)}else if(d&&d.test(v)){var b=t[v],_=b.cameraposition;if(Array.isArray(_)&&4===_[0].length){var w=_[0],T=_[1],k=_[2],M=a([],w),A=[];for(n=0;n<3;++n)A[n]=T[n]+k*M[2+4*n];b.camera={eye:{x:A[0],y:A[1],z:A[2]},center:{x:T[0],y:T[1],z:T[2]},up:{x:0,y:0,z:1}},delete b.cameraposition}h(b.xaxis),h(b.yaxis),h(b.zaxis)}}var L=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<L;e++){var S=t.annotations[e];o.isPlainObject(S)&&(S.ref&&("paper"===S.ref?(S.xref="paper",S.yref="paper"):"data"===S.ref&&(S.xref="x",S.yref="y"),delete S.ref),p(S,"xref"),p(S,"yref"))}var C=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<C;e++){var O=t.shapes[e];o.isPlainObject(O)&&(p(O,"xref"),p(O,"yref"))}var D=Array.isArray(t.images)?t.images.length:0;for(e=0;e<D;e++){var z=t.images[e];o.isPlainObject(z)&&(p(z,"xref"),p(z,"yref"))}var P=t.legend;return P&&(P.x>3?(P.x=1.02,P.xanchor="left"):P.x<-2&&(P.x=-.02,P.xanchor="right"),P.y>3?(P.y=1.02,P.yanchor="bottom"):P.y<-2&&(P.y=-.02,P.yanchor="top")),h(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),c.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e<t.length;e++){var n,a=t[e];if("histogramy"===a.type&&"xbins"in a&&!("ybins"in a)&&(a.ybins=a.xbins,delete a.xbins),a.error_y&&"opacity"in a.error_y){var s=c.defaults,f=a.error_y.color||(d(a,"bar")?c.defaultLine:s[e%s.length]);a.error_y.color=c.addOpacity(c.rgb(f),c.opacity(f)*a.error_y.opacity),delete a.error_y.opacity}if("bardir"in a&&("h"!==a.bardir||!d(a,"bar")&&"histogram"!==a.type.substr(0,9)||(a.orientation="h",r.swapXYData(a)),delete a.bardir),"histogramy"===a.type&&r.swapXYData(a),"histogramx"!==a.type&&"histogramy"!==a.type||(a.type="histogram"),"scl"in a&&!("colorscale"in a)&&(a.colorscale=a.scl,delete a.scl),"reversescl"in a&&!("reversescale"in a)&&(a.reversescale=a.reversescl,delete a.reversescl),a.xaxis&&(a.xaxis=u(a.xaxis,"x")),a.yaxis&&(a.yaxis=u(a.yaxis,"y")),d(a,"gl3d")&&a.scene&&(a.scene=l.subplotsRegistry.gl3d.cleanId(a.scene)),!d(a,"pie-like")&&!d(a,"bar-like"))if(Array.isArray(a.textposition))for(n=0;n<a.textposition.length;n++)a.textposition[n]=m(a.textposition[n]);else a.textposition&&(a.textposition=m(a.textposition));var p=i.getModule(a);if(p&&p.colorbar){var x=p.colorbar.container,b=x?a[x]:a;b&&b.colorscale&&("YIGnBu"===b.colorscale&&(b.colorscale="YlGnBu"),"YIOrRd"===b.colorscale&&(b.colorscale="YlOrRd"))}if("surface"===a.type&&o.isPlainObject(a.contours)){var _=["x","y","z"];for(n=0;n<_.length;n++){var w=a.contours[_[n]];o.isPlainObject(w)&&(w.highlightColor&&(w.highlightcolor=w.highlightColor,delete w.highlightColor),w.highlightWidth&&(w.highlightwidth=w.highlightWidth,delete w.highlightWidth))}}if("candlestick"===a.type||"ohlc"===a.type){var T=!1!==(a.increasing||{}).showlegend,k=!1!==(a.decreasing||{}).showlegend,M=g(a.increasing),A=g(a.decreasing);if(!1!==M&&!1!==A){var L=v(M,A,T,k);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,D=Object.keys(O);C.styles=[];for(var z=0;z<D.length;z++)C.styles.push({target:D[z],value:O[D[z]]})}}}}y(a,"line")&&delete a.line,"marker"in a&&(y(a.marker,"line")&&delete a.marker.line,y(a,"marker")&&delete a.marker),c.clean(a),a.autobinx&&(delete a.autobinx,delete a.xbins),a.autobiny&&(delete a.autobiny,delete a.ybins),h(a),a.colorbar&&h(a.colorbar),a.marker&&a.marker.colorbar&&h(a.marker.colorbar),a.line&&a.line.colorbar&&h(a.line.colorbar),a.aaxis&&h(a.aaxis),a.baxis&&h(a.baxis)}},r.swapXYData=function(t){var e;if(o.swapAttrs(t,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(t.z)&&Array.isArray(t.z[0])&&(t.transpose?delete t.transpose:t.transpose=!0),t.error_x&&t.error_y){var r=t.error_y,n="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);o.swapAttrs(t,["error_?.copy_ystyle"]),n&&o.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if("string"==typeof t.hoverinfo){var a=t.hoverinfo.split("+");for(e=0;e<a.length;e++)"x"===a[e]?a[e]="y":"y"===a[e]&&(a[e]="x");t.hoverinfo=a.join("+")}},r.coerceTraceIndices=function(t,e){if(n(e))return[e];if(!Array.isArray(e)||!e.length)return t.data.map((function(t,e){return e}));if(Array.isArray(e)){for(var r=[],a=0;a<e.length;a++)o.isIndex(e[a],t.data.length)?r.push(e[a]):o.warn("trace index (",e[a],") is not a number or is out of bounds");return r}return e},r.manageArrayContainers=function(t,e,r){var a=t.obj,i=t.parts,l=i.length,s=i[l-1],c=n(s);if(c&&null===e){var u=i.slice(0,l-1).join(".");o.nestedProperty(a,u).get().splice(s,1)}else c&&void 0===t.get()?(void 0===t.get()&&(r[t.astr]=null),t.set(e)):t.set(e)};var x=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function b(t){var e=t.search(x);if(e>0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=b(e);r;){if(r in t)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n<e.length;n++)for(var a=t._fullData[n],i=0;i<3;i++){var l=f(t,a,_[i]);if(l&&"log"!==l.type){var s=l._name,c=l._id.substr(1);if("scene"===c.substr(0,5)){if(void 0!==r[c])continue;s=c+"."+s}var u=s+".type";void 0===r[s]&&void 0===r[u]&&o.nestedProperty(t.layout,u).set(null)}}}},{"../components/color":105,"../lib":233,"../plots/cartesian/axis_ids":282,"../plots/plots":313,"../registry":326,"fast-isnumeric":23,"gl-mat4/fromQuat":29}],263:[function(t,e,r){"use strict";var n=t("./plot_api");r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r._guiRestyle=n._guiRestyle,r._guiRelayout=n._guiRelayout,r._guiUpdate=n._guiUpdate,r._storeDirectGUIEdit=n._storeDirectGUIEdit,r.react=n.react,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.setPlotConfig=n.setPlotConfig,r.toImage=t("./to_image"),r.validate=t("./validate"),r.downloadImage=t("../snapshot/download");var a=t("./template_api");r.makeTemplate=a.makeTemplate,r.validateTemplate=a.validateTemplate},{"../snapshot/download":328,"./plot_api":265,"./template_api":270,"./to_image":271,"./validate":272}],264:[function(t,e,r){"use strict";var n=t("../lib/is_plain_object"),a=t("../lib/noop"),i=t("../lib/loggers"),o=t("../lib/search").sorterAsc,l=t("../registry");r.containerArrayMatch=t("./container_array_match");var s=r.isAddVal=function(t){return"add"===t||n(t)},c=r.isRemoveVal=function(t){return null===t||"remove"===t};r.applyContainerArrayChanges=function(t,e,r,n,u){var f=e.astr,d=l.getComponentMethod(f,"supplyLayoutDefaults"),p=l.getComponentMethod(f,"draw"),h=l.getComponentMethod(f,"drawOne"),g=n.replot||n.recalc||d===a||p===a,v=t.layout,m=t._fullLayout;if(r[""]){Object.keys(r).length>1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))e.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(d(v,m),p(t),!0)}var x,b,_,w,T,k,M,A,L=Object.keys(r).map(Number).sort(o),S=e.get(),C=S||[],O=u(m,f).get(),D=[],z=-1,P=C.length;for(x=0;x<L.length;x++)if(w=r[_=L[x]],T=Object.keys(w),k=w[""],M=s(k),_<0||_>C.length-(M?0:1))i.warn("index out of range",f,_);else if(void 0!==k)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(k)?D.push(_):M?("add"===k&&(k={}),C.splice(_,0,k),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,k),-1===z&&(z=_);else for(b=0;b<T.length;b++)A=f+"["+_+"].",u(C[_],T[b],A).set(w[T[b]]);for(x=D.length-1;x>=0;x--)C.splice(D[x],1),O&&O.splice(D[x],1);if(C.length?S||e.set(C):e.set(null),g)return!1;if(d(v,m),h!==a){var E;if(-1===z)E=L;else{for(P=Math.max(C.length,P),E=[],x=0;x<L.length&&!((_=L[x])>=z);x++)E.push(_);for(x=z;x<P;x++)E.push(x)}for(x=0;x<E.length;x++)h(t,E[x])}else p(t);return!0}},{"../lib/is_plain_object":234,"../lib/loggers":237,"../lib/noop":242,"../lib/search":252,"../registry":326,"./container_array_match":260}],265:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("has-hover"),o=t("../lib"),l=o.nestedProperty,s=t("../lib/events"),c=t("../lib/queue"),u=t("../registry"),f=t("./plot_schema"),d=t("../plots/plots"),p=t("../plots/polar/legacy"),h=t("../plots/cartesian/axes"),g=t("../components/drawing"),v=t("../components/color"),m=t("../plots/cartesian/graph_interact").initInteractions,y=t("../constants/xmlns_namespaces"),x=t("../lib/svg_text_utils"),b=t("../plots/cartesian/select").clearSelect,_=t("./plot_config").dfltConfig,w=t("./manage_arrays"),T=t("./helpers"),k=t("./subroutines"),M=t("./edit_types"),A=t("../plots/cartesian/constants").AX_NAME_PATTERN,L=0;function S(t){var e=t._fullLayout;e._redrawFromAutoMarginCount?e._redrawFromAutoMarginCount--:t.emit("plotly_afterplot")}function C(t,e){try{t._fullLayout._paper.style("background",e)}catch(t){o.error(t)}}function O(t,e){C(t,v.combine(e,"white"))}function D(t,e){if(!t._context){t._context=o.extendDeep({},_);var r=n.select("base");t._context._baseUrl=r.size()&&r.attr("href")?window.location.href.split("#")[0]:""}var a,l,s,c=t._context;if(e){for(l=Object.keys(e),a=0;a<l.length;a++)"editable"!==(s=l[a])&&"edits"!==s&&s in c&&("setBackground"===s&&"opaque"===e[s]?c[s]=O:c[s]=e[s]);e.plot3dPixelRatio&&!c.plotGlPixelRatio&&(c.plotGlPixelRatio=c.plot3dPixelRatio);var u=e.editable;if(void 0!==u)for(c.editable=u,l=Object.keys(c.edits),a=0;a<l.length;a++)c.edits[l[a]]=u;if(e.edits)for(l=Object.keys(e.edits),a=0;a<l.length;a++)(s=l[a])in c.edits&&(c.edits[s]=e.edits[s]);c._exportedPlot=e._exportedPlot}c.staticPlot&&(c.editable=!1,c.edits={},c.autosizable=!1,c.scrollZoom=!1,c.doubleClick=!1,c.showTips=!1,c.showLink=!1,c.displayModeBar=!1),"hover"!==c.displayModeBar||i||(c.displayModeBar=!0),"transparent"!==c.setBackground&&"function"==typeof c.setBackground||(c.setBackground=C),c._hasZeroHeight=c._hasZeroHeight||0===t.clientHeight,c._hasZeroWidth=c._hasZeroWidth||0===t.clientWidth;var f=c.scrollZoom,d=c._scrollZoom={};if(!0===f)d.cartesian=1,d.gl3d=1,d.geo=1,d.mapbox=1;else if("string"==typeof f){var p=f.split("+");for(a=0;a<p.length;a++)d[p[a]]=1}else!1!==f&&(d.gl3d=1,d.geo=1,d.mapbox=1)}function z(t,e){var r,n,a=e+1,i=[];for(r=0;r<t.length;r++)(n=t[r])<0?i.push(a+n):i.push(n);return i}function P(t,e,r){var n,a;for(n=0;n<e.length;n++){if((a=e[n])!==parseInt(a,10))throw new Error("all values in "+r+" must be integers");if(a>=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&P(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in P(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var s=function(t,e,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=z(r,t.data.length-1),e)for(var g=0;g<r.length;g++){if(i=t.data[r[g]],s=(c=l(i,h)).get(),u=e[h][g],!o.isArrayOrTypedArray(u))throw new Error("attribute: "+h+" index: "+g+" must be an array");if(!o.isArrayOrTypedArray(s))throw new Error("cannot extend missing or non-array attribute: "+h);if(s.constructor!==u.constructor)throw new Error("cannot extend array with an array of a different type: "+h);f=d?n[h][g]:n,a(f)||(f=-1),p.push({prop:c,target:s,insert:u,maxp:Math.floor(f)})}return p}(t,e,r,n),c={},u={},f=0;f<s.length;f++){var d=s[f].prop,p=s[f].maxp,h=i(s[f].target,s[f].insert,p);d.set(h[0]),Array.isArray(c[d.astr])||(c[d.astr]=[]),c[d.astr].push(h[1]),Array.isArray(u[d.astr])||(u[d.astr]=[]),u[d.astr].push(s[f].target.length)}return{update:c,maxPoints:u}}function R(t,e){var r=new t.constructor(t.length+e.length);return r.set(t),r.set(e,t.length),r}function F(t,e,n,a){t=o.getGraphDiv(t),T.clearPromiseQueue(t);var i={};if("string"==typeof e)i[e]=n;else{if(!o.isPlainObject(e))return o.warn("Restyle fail.",e,n,a),Promise.reject();i=o.extendFlat({},e),void 0===a&&(a=n)}Object.keys(i).length&&(t.changed=!0);var l=T.coerceTraceIndices(t,a),s=j(t,i,l),u=s.flags;u.calc&&(t.calcdata=void 0),u.clearAxisTypes&&T.clearAxisTypes(t,l,{});var f=[];u.fullReplot?f.push(r.plot):(f.push(d.previousPromises),d.supplyDefaults(t),u.markerSize&&(d.doCalcdata(t),G(f)),u.style&&f.push(k.doTraceStyle),u.colorbars&&f.push(k.doColorBars),f.push(S)),f.push(d.rehover,d.redrag),c.add(t,F,[t,s.undoit,s.traces],F,[t,s.redoit,s.traces]);var p=o.syncOrAsync(f,t);return p&&p.then||(p=Promise.resolve()),p.then((function(){return t.emit("plotly_restyle",s.eventData),t}))}function N(t){return void 0===t?null:t}function B(t,e){return e?function(e,r,n){var a=l(e,r),i=a.set;return a.set=function(e){H((n||"")+r,a.get(),e,t),i(e)},a}:l}function H(t,e,r,n){if(Array.isArray(e)||Array.isArray(r))for(var a=Array.isArray(e)?e:[],i=Array.isArray(r)?r:[],l=Math.max(a.length,i.length),s=0;s<l;s++)H(t+"["+s+"]",a[s],i[s],n);else if(o.isPlainObject(e)||o.isPlainObject(r)){var c=o.isPlainObject(e)?e:{},u=o.isPlainObject(r)?r:{},f=o.extendFlat({},c,u);for(var d in f)H(t+"."+d,c[d],u[d],n)}else void 0===n[t]&&(n[t]=N(e))}function j(t,e,r){var n,a=t._fullLayout,i=t._fullData,s=t.data,c=a._guiEditing,p=B(a._preGUI,c),g=o.extendDeepAll({},e);U(e);var v,m=M.traceFlags(),y={},x={};function b(){return r.map((function(){}))}function _(t){var e=h.id2name(t);-1===v.indexOf(e)&&v.push(e)}function w(t){return"LAYOUT"+t+".autorange"}function k(t){return"LAYOUT"+t+".range"}function A(t){for(var e=t;e<i.length;e++)if(i[e]._input===s[t])return i[e]}function L(n,i,o){if(Array.isArray(n))n.forEach((function(t){L(t,i,o)}));else if(!(n in e)&&!T.hasParent(e,n)){var l;if("LAYOUT"===n.substr(0,6))l=p(t.layout,n.replace("LAYOUT",""));else{var u=r[o];l=B(a._tracePreGUI[A(u)._fullInput.uid],c)(s[u],n)}n in x||(x[n]=b()),void 0===x[n][o]&&(x[n][o]=N(l.get())),void 0!==i&&l.set(i)}}function S(t){return function(e){return i[e][t]}}function C(t){return function(e,n){return!1===e?i[r[n]][t]:null}}for(var O in e){if(T.hasParent(e,O))throw new Error("cannot set "+O+" and a parent attribute simultaneously");var D,z,P,E,I,R,F=e[O];if("autobinx"!==O&&"autobiny"!==O||(O=O.charAt(O.length-1)+"bins",F=Array.isArray(F)?F.map(C(O)):!1===F?r.map(S(O)):null),y[O]=F,"LAYOUT"!==O.substr(0,6)){for(x[O]=b(),n=0;n<r.length;n++){if(D=s[r[n]],z=A(r[n]),E=(P=B(a._tracePreGUI[z._fullInput.uid],c)(D,O)).get(),void 0!==(I=Array.isArray(F)?F[n%F.length]:F)){var H=P.parts[P.parts.length-1],j=O.substr(0,O.length-H.length-1),V=j?j+".":"",q=j?l(z,j).get():z;if((R=f.getTraceValObject(z,P.parts))&&R.impliedEdits&&null!==I)for(var G in R.impliedEdits)L(o.relativeAttr(O,G),R.impliedEdits[G],n);else if("thicknessmode"!==H&&"lenmode"!==H||E===I||"fraction"!==I&&"pixels"!==I||!q){if("type"===O&&("pie"===I!=("pie"===E)||"funnelarea"===I!=("funnelarea"===E))){var Z="x",Y="y";"bar"!==I&&"bar"!==E||"h"!==D.orientation||(Z="y",Y="x"),o.swapAttrs(D,["?","?src"],"labels",Z),o.swapAttrs(D,["d?","?0"],"label",Z),o.swapAttrs(D,["?","?src"],"values",Y),"pie"===E||"funnelarea"===E?(l(D,"marker.color").set(l(D,"marker.colors").get()),a._pielayer.selectAll("g.trace").remove()):u.traceIs(D,"cartesian")&&l(D,"marker.colors").set(l(D,"marker.color").get())}}else{var X=a._size,W=q.orient,Q="top"===W||"bottom"===W;if("thicknessmode"===H){var J=Q?X.h:X.w;L(V+"thickness",q.thickness*("fraction"===I?1/J:J),n)}else{var $=Q?X.w:X.h;L(V+"len",q.len*("fraction"===I?1/$:$),n)}}x[O][n]=N(E);if(-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(O)){if("orientation"===O){P.set(I);var K=D.x&&!D.y?"h":"v";if((P.get()||K)===z.orientation)continue}else"orientationaxes"===O&&(D.orientation={v:"h",h:"v"}[z.orientation]);T.swapXYData(D),m.calc=m.clearAxisTypes=!0}else-1!==d.dataArrayContainers.indexOf(P.parts[0])?(T.manageArrayContainers(P,I,x),m.calc=!0):(R?R.arrayOk&&!u.traceIs(z,"regl")&&(o.isArrayOrTypedArray(I)||o.isArrayOrTypedArray(E))?m.calc=!0:M.update(m,R):m.calc=!0,P.set(I))}}if(-1!==["swapxyaxes","orientationaxes"].indexOf(O)&&h.swap(t,r),"orientationaxes"===O){var tt=l(t.layout,"hovermode"),et=tt.get();"x"===et?tt.set("y"):"y"===et?tt.set("x"):"x unified"===et?tt.set("y unified"):"y unified"===et&&tt.set("x unified")}if(-1!==["orientation","type"].indexOf(O)){for(v=[],n=0;n<r.length;n++){var rt=s[r[n]];u.traceIs(rt,"cartesian")&&(_(rt.xaxis||"x"),_(rt.yaxis||"y"))}L(v.map(w),!0,0),L(v.map(k),[0,1],0)}}else P=p(t.layout,O.replace("LAYOUT","")),x[O]=[N(P.get())],P.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 U(t){var e,r,n,a=o.counterRegex("axis",".title",!1,!1),i=/colorbar\.title$/,l=Object.keys(t);for(e=0;e<l.length;e++)r=l[e],n=t[r],"title"!==r&&!a.test(r)&&!i.test(r)||"string"!=typeof n&&"number"!=typeof n?r.indexOf("titlefont")>-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(e,r){t[r]=t[e],delete t[e]}}function V(t,e,r){if(t=o.getGraphDiv(t),T.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=W(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(k.layoutReplot):Object.keys(n).length&&(q(t,i,a)||d.supplyDefaults(t),i.legend&&l.push(k.doLegend),i.layoutstyle&&l.push(k.layoutStyles),i.axrange&&G(l,a.rangesAltered),i.ticks&&l.push(k.doTicksRelayout),i.modebar&&l.push(k.doModeBar),i.camera&&l.push(k.doCamera),i.colorbars&&l.push(k.doColorBars),l.push(S)),l.push(d.rehover,d.redrag),c.add(t,V,[t,a.undoit],V,[t,a.redoit]);var s=o.syncOrAsync(l,t);return s&&s.then||(s=Promise.resolve(t)),s.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function q(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var a in e)if("axrange"!==a&&e[a])return!1;for(var i in r.rangesAltered){var o=h.id2name(i),l=t.layout[o],s=n[o];if(s.autorange=l.autorange,l.range&&(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(t,e){var r=e?function(t){var r=[],n=!0;for(var a in e){var i=h.getFromId(t,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)e[o]||r.push(o);i.automargin&&(n=!1)}return h.draw(t,r,{skipTitle:n})}:function(t){return h.draw(t,"redraw")};t.push(b,k.doAutoRangeAndConstraints,r,k.drawData,k.finalDraw)}var Z=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Y=/^[xyz]axis[0-9]*\.autorange$/,X=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(t,e){var r,n,a,i=t.layout,s=t._fullLayout,c=s._guiEditing,d=B(s._preGUI,c),p=Object.keys(e),g=h.list(t),v=o.extendDeepAll({},e),m={};for(U(e),p=Object.keys(e),n=0;n<p.length;n++)if(0===p[n].indexOf("allaxes")){for(a=0;a<g.length;a++){var y=g[a]._id.substr(1),x=-1!==y.indexOf("scene")?y+".":"",b=p[n].replace("allaxes",x+g[a]._name);e[b]||(e[b]=e[p[n]])}delete e[p[n]]}var _=M.layoutFlags(),k={},L={};function S(t,r){if(Array.isArray(t))t.forEach((function(t){S(t,r)}));else if(!(t in e)&&!T.hasParent(e,t)){var n=d(i,t);t in L||(L[t]=N(n.get())),void 0!==r&&n.set(r)}}var C,O={};function D(t){var e=h.name2id(t.split(".")[0]);return O[e]=1,e}for(var z in e){if(T.hasParent(e,z))throw new Error("cannot set "+z+" and a parent attribute simultaneously");for(var P=d(i,z),E=e[z],I=P.parts.length-1;I>0&&"string"!=typeof P.parts[I];)I--;var R=P.parts[I],F=P.parts[I-1]+"."+R,H=P.parts.slice(0,I).join("."),j=l(t.layout,H).get(),V=l(s,H).get(),q=P.get();if(void 0!==E){k[z]=E,L[z]="reverse"===R?E:N(q);var G=f.getLayoutValObject(s,P.parts);if(G&&G.impliedEdits&&null!==E)for(var W in G.impliedEdits)S(o.relativeAttr(z,W),G.impliedEdits[W]);if(-1!==["width","height"].indexOf(z))if(E){S("autosize",null);var J="height"===z?"width":"height";S(J,s[J])}else s[z]=t._initialAutoSize[z];else if("autosize"===z)S("width",E?null:s.width),S("height",E?null:s.height);else if(F.match(Z))D(F),l(s,H+"._inputRange").set(null);else if(F.match(Y)){D(F),l(s,H+"._inputRange").set(null);var $=l(s,H).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else F.match(X)&&l(s,H+"._inputDomain").set(null);if("type"===R){C=j;var K="linear"===V.type&&"log"===E,tt="log"===V.type&&"linear"===E;if(K||tt){if(C&&C.range)if(V.autorange)K&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var et=C.range[0],rt=C.range[1];K?(et<=0&&rt<=0&&S(H+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),S(H+".range[0]",Math.log(et)/Math.LN10),S(H+".range[1]",Math.log(rt)/Math.LN10)):(S(H+".range[0]",Math.pow(10,et)),S(H+".range[1]",Math.pow(10,rt)))}else S(H+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[P.parts[0]]&&"radialaxis"===P.parts[1]&&delete s[P.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,V,E,S),u.getComponentMethod("images","convertCoords")(t,V,E,S)}else S(H+".autorange",!0),S(H+".range",null);l(s,H+"._inputRange").set(null)}else if(R.match(A)){var nt=l(s,z).get(),at=(E||{}).type;at&&"-"!==at||(at="linear"),u.getComponentMethod("annotations","convertCoords")(t,nt,at,S),u.getComponentMethod("images","convertCoords")(t,nt,at,S)}var it=w.containerArrayMatch(z);if(it){r=it.array,n=it.index;var ot=it.property,lt=G||{editType:"calc"};""!==n&&""===ot&&(w.isAddVal(E)?L[z]=null:w.isRemoveVal(E)?L[z]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),M.update(_,lt),m[r]||(m[r]={});var st=m[r][n];st||(st=m[r][n]={}),st[ot]=E,delete e[z]}else"reverse"===R?(j.range?j.range.reverse():(S(H+".autorange",!0),j.range=[1,0]),V.autorange?_.calc=!0:_.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===z&&("lasso"===E||"select"===E)&&"lasso"!==q&&"select"!==q||s._has("gl2d")?_.plot=!0:G?M.update(_,G):_.calc=!0,P.set(E))}}for(r in m){w.applyContainerArrayChanges(t,d(i,r),m[r],_,d)||(_.plot=!0)}for(var ct in O){var ut=(C=h.getFromId(t,ct))&&C._constraintGroup;if(ut)for(var ft in _.calc=!0,ut)O[ft]||(h.getFromId(t,ft)._constraintShrinkable=!0)}return(Q(t)||e.height||e.width)&&(_.plot=!0),(_.plot||_.calc)&&(_.layoutReplot=!0),{flags:_,rangesAltered:O,undoit:L,redoit:k,eventData:v}}function Q(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&d.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function J(t,e,n,a){if(t=o.getGraphDiv(t),T.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var i=T.coerceTraceIndices(t,a),l=j(t,o.extendFlat({},e),i),s=l.flags,u=W(t,o.extendFlat({},n)),f=u.flags;(s.calc||f.calc)&&(t.calcdata=void 0),s.clearAxisTypes&&T.clearAxisTypes(t,i,n);var p=[];f.layoutReplot?p.push(k.layoutReplot):s.fullReplot?p.push(r.plot):(p.push(d.previousPromises),q(t,f,u)||d.supplyDefaults(t),s.style&&p.push(k.doTraceStyle),(s.colorbars||f.colorbars)&&p.push(k.doColorBars),f.legend&&p.push(k.doLegend),f.layoutstyle&&p.push(k.layoutStyles),f.axrange&&G(p,u.rangesAltered),f.ticks&&p.push(k.doTicksRelayout),f.modebar&&p.push(k.doModeBar),f.camera&&p.push(k.doCamera),p.push(S)),p.push(d.rehover,d.redrag),c.add(t,J,[t,l.undoit,u.undoit,l.traces],J,[t,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,t);return h&&h.then||(h=Promise.resolve(t)),h.then((function(){return t.emit("plotly_update",{data:l.eventData,layout:u.eventData}),t}))}function $(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._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"}],tt=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function et(t,e){for(var r=0;r<e.length;r++){var n=e[r],a=t.match(n.pattern);if(a)return{head:a[1],attr:n.attr}}}function rt(t,e){var r=l(e,t).get();if(void 0!==r)return r;var n=t.split(".");for(n.pop();n.length>1;)if(n.pop(),void 0!==(r=l(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r<e.length;r++)if(e[r]._fullInput.uid===t)return r;return-1}function at(t,e,r){for(var n=0;n<e.length;n++)if(e[n].uid===t)return n;return!e[r]||e[r].uid?-1:r}function it(t,e){var r=o.isPlainObject(t),n=Array.isArray(t);return r||n?(r&&o.isPlainObject(e)||n&&Array.isArray(e))&&JSON.stringify(t)===JSON.stringify(e):t===e}function ot(t,e,r,n){var a,i,s,c=n.getValObject,u=n.flags,f=n.immutable,d=n.inArray,p=n.arrayIndex;function h(){var t=a.editType;d&&-1!==t.indexOf("arraydraw")?o.pushUnique(u.arrays[d],p):(M.update(u,a),"none"!==t&&u.nChanges++,n.transition&&a.anim&&u.nChangesAnim++,(Z.test(s)||Y.test(s))&&(u.rangesAltered[r[0]]=1),X.test(s)&&l(e,"_inputDomain").set(null),"datarevision"===i&&(u.newDataRevision=1))}function g(t){return"data_array"===t.valType||t.arrayOk}for(i in t){if(u.calc&&!n.transition)return;var v=t[i],m=e[i],y=r.concat(i);if(s=y.join("."),"_"!==i.charAt(0)&&"function"!=typeof v&&v!==m){if(("tick0"===i||"dtick"===i)&&"geo"!==r[0]){var x=e.tickmode;if("auto"===x||"array"===x||!x)continue}if(("range"!==i||!e.autorange)&&("zmin"!==i&&"zmax"!==i||"contourcarpet"!==e.type)&&(a=c(y))&&(!a._compareAsJSON||JSON.stringify(v)!==JSON.stringify(m))){var b,_=a.valType,w=g(a),T=Array.isArray(v),k=Array.isArray(m);if(T&&k){var A="_input_"+i,L=t[A],S=e[A];if(Array.isArray(L)&&L===S)continue}if(void 0===m)w&&T?u.calc=!0:h();else if(a._isLinkedToArray){var C=[],O=!1;d||(u.arrays[i]=C);var D=Math.min(v.length,m.length),z=Math.max(v.length,m.length);if(D!==z){if("arraydraw"!==a.editType){h();continue}O=!0}for(b=0;b<D;b++)ot(v[b],m[b],y.concat(b),o.extendFlat({inArray:i,arrayIndex:b},n));if(O)for(b=D;b<z;b++)C.push(b)}else!_&&o.isPlainObject(v)?ot(v,m,y,n):w?T&&k?(f&&(u.calc=!0),(f||n.newDataRevision)&&h()):T!==k?u.calc=!0:h():T&&k&&v.length===m.length&&String(v)===String(m)||h()}}}for(i in e)if(!(i in t)&&"_"!==i.charAt(0)&&"function"!=typeof e[i]){if(g(a=c(r.concat(i)))&&Array.isArray(e[i]))return void(u.calc=!0);h()}}function lt(t){var e=t._fullLayout,r=t.getBoundingClientRect();if(!o.equalDomRects(r,e._lastBBox)){var n=e._invTransform=o.inverseTransformMatrix(o.getFullTransformMatrix(t));e._invScaleX=Math.sqrt(n[0][0]*n[0][0]+n[0][1]*n[0][1]+n[0][2]*n[0][2]),e._invScaleY=Math.sqrt(n[1][0]*n[1][0]+n[1][1]*n[1][1]+n[1][2]*n[1][2]),e._lastBBox=r}}function st(t){var e=n.select(t),r=t._fullLayout;if(r._calcInverseTransform=lt,r._calcInverseTransform(t),r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("user-select-none",!0).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"),delete r._modeBar,r._hoverpaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var a={};n.selectAll("defs").each((function(){this.id&&(a[this.id.split("-")[1]]=1)})),r._uid=o.randstr(a)}r._paperdiv.selectAll(".main-svg").attr(y.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._clips=r._defs.append("g").classed("clips",!0),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._topclips=r._topdefs.append("g").classed("clips",!0),r._bgLayer=r._paper.append("g").classed("bglayer",!0),r._draggers=r._paper.append("g").classed("draglayer",!0);var i=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=i.append("g").classed("imagelayer",!0),r._shapeLowerLayer=i.append("g").classed("shapelayer",!0),r._cartesianlayer=r._paper.append("g").classed("cartesianlayer",!0),r._polarlayer=r._paper.append("g").classed("polarlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0),r._geolayer=r._paper.append("g").classed("geolayer",!0),r._funnelarealayer=r._paper.append("g").classed("funnelarealayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._treemaplayer=r._paper.append("g").classed("treemaplayer",!0),r._sunburstlayer=r._paper.append("g").classed("sunburstlayer",!0),r._indicatorlayer=r._toppaper.append("g").classed("indicatorlayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0);var l=r._toppaper.append("g").classed("layer-above",!0);r._imageUpperLayer=l.append("g").classed("imagelayer",!0),r._shapeUpperLayer=l.append("g").classed("shapelayer",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._menulayer=r._toppaper.append("g").classed("menulayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._hoverpaper.append("g").classed("hoverlayer",!0),r._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),t.emit("plotly_framework")}r.animate=function(t,e,r){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/");var n=t._transitionData;n._frameQueue||(n._frameQueue=[]);var a=(r=d.supplyAnimationDefaults(r)).transition,i=r.frame;function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function s(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,d.transition(t,e.frame.data,e.frame.layout,T.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var h,g,v=0;function m(t){return Array.isArray(a)?v>=a.length?t.transitionOpts=a[v]:t.transitionOpts=a[0]:t.transitionOpts=a,v++,t}var y=[],x=null==e,b=Array.isArray(e);if(!x&&!b&&o.isPlainObject(e))y.push({type:"object",data:m(o.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(h=0;h<n._frames.length;h++)(g=n._frames[h])&&(x||String(g.group)===String(e))&&y.push({type:"byname",name:String(g.name),data:m({name:g.name})});else if(b)for(h=0;h<e.length;h++){var _=e[h];-1!==["number","string"].indexOf(typeof _)?(_=String(_),y.push({type:"byname",name:_,data:m({name:_})})):o.isPlainObject(_)&&y.push({type:"object",data:m(o.extendFlat({},_))})}for(h=0;h<y.length;h++)if("byname"===(g=y[h]).type&&!n._frameHash[g.data.name])return o.warn('animate failure: frame not found: "'+g.data.name+'"'),void u();-1!==["next","immediate"].indexOf(r.mode)&&function(){if(0!==n._frameQueue.length){for(;n._frameQueue.length;){var e=n._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&y.reverse();var w=t._fullLayout._currentFrame;if(w&&r.fromcurrent){var k=-1;for(h=0;h<y.length;h++)if("byname"===(g=y[h]).type&&g.name===w){k=h;break}if(k>0&&k<y.length-1){var M=[];for(h=0;h<y.length;h++)g=y[h],("byname"!==y[h].type||h>k)&&M.push(g);y=M}}y.length>0?function(e){if(0!==e.length){for(var a=0;a<e.length;a++){var o;o="byname"===e[a].type?d.computeFrame(t,e[a].name):e[a].data;var f=s(a),h=l(a);h.duration=Math.min(h.duration,f.duration);var g={frame:o,name:e[a].name,frameOpts:f,transitionOpts:h};a===e.length-1&&(g.onComplete=c(i,2),g.onInterrupt=u),n._frameQueue.push(g)}"immediate"===r.mode&&(n._lastFrameAt=-1/0),n._animationRaf||p()}}(y):(t.emit("plotly_animated"),i())}))},r.addFrames=function(t,e,r){if(t=o.getGraphDiv(t),null==e)return Promise.resolve();if(!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var n,a,i,l,s=t._transitionData._frames,u=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var f=s.length+2*e.length,p=[],h={};for(n=e.length-1;n>=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(u[g]||h[g]||{}).name,m=e[n].name,y=u[v]||h[v];v&&m&&"number"==typeof m&&y&&L<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(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(t,e){return t.index>e.index?-1:t.index<e.index?1:0}));var x=[],b=[],_=s.length;for(n=p.length-1;n>=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+t._transitionData._counter++];);if(u[a.name]){for(i=0;i<s.length&&(s[i]||{}).name!==a.name;i++);x.push({type:"replace",index:i,value:a}),b.unshift({type:"replace",index:i,value:s[i]})}else l=Math.max(0,Math.min(p[n].index,_)),x.push({type:"insert",index:l,value:a}),b.unshift({type:"delete",index:l}),_++}var w=d.modifyFrames,T=d.modifyFrames,k=[t,b],M=[t,x];return c&&c.add(t,w,k,T,M),d.modifyFrames(t,x)},r.deleteFrames=function(t,e){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);var r,n,a=t._transitionData._frames,i=[],l=[];if(!e)for(e=[],r=0;r<a.length;r++)e.push(r);for((e=e.slice()).sort(),r=e.length-1;r>=0;r--)n=e[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[t,l],p=[t,i];return c&&c.add(t,s,f,u,p),d.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,l,s=[],u=r.deleteTraces,f=t,d=[e,s],p=[e,n];for(function(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n<e.length;n++)if("object"!=typeof(a=e[n])||Array.isArray(a)||null===a)throw new Error("all values in traces array must be non-array objects");if("undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&r.length!==e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}(e,n,a),Array.isArray(n)||(n=[n]),n=n.map((function(t){return o.extendFlat({},t)})),T.cleanData(n),i=0;i<n.length;i++)e.data.push(n[i]);for(i=0;i<n.length;i++)s.push(-n.length+i);if("undefined"==typeof a)return l=r.redraw(e),c.add(e,u,d,f,p),l;Array.isArray(a)||(a=[a]);try{E(e,s,a)}catch(t){throw e.data.splice(e.data.length-n.length,n.length),t}return c.startSequence(e),c.add(e,u,d,f,p),l=r.moveTraces(e,s,a),c.stopSequence(e),l},r.deleteTraces=function t(e,n){e=o.getGraphDiv(e);var a,i,l=[],s=r.addTraces,u=t,f=[e,l,n],d=[e,n];if("undefined"==typeof n)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),P(e,n,"indices"),(n=z(n,e.data.length-1)).sort(o.sorterDes),a=0;a<n.length;a+=1)i=e.data.splice(n[a],1)[0],l.push(i);var p=r.redraw(e);return c.add(e,s,f,u,d),p},r.extendTraces=function t(e,n,a,i){function l(t,e,r){var n,a;if(o.isTypedArray(t))if(r<0){var i=new t.constructor(0),l=R(t,e);r<0?(n=l,a=i):(n=i,a=l)}else if(n=new t.constructor(r),a=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),a.set(t);else if(r<e.length){var s=e.length-r;n.set(e.subarray(s)),a.set(t),a.set(e.subarray(0,s),t.length)}else{var c=r-e.length,u=t.length-c;n.set(t.subarray(u)),n.set(e,c),a.set(t.subarray(0,u))}else n=t.concat(e),a=r>=0&&r<n.length?n.splice(0,n.length-r):[];return[n,a]}var s=I(e=o.getGraphDiv(e),n,a,i,l),u=r.redraw(e),f=[e,s.update,a,s.maxPoints];return c.add(e,r.prependTraces,f,t,arguments),u},r.moveTraces=function t(e,n,a){var i,l=[],s=[],u=t,f=t,d=[e=o.getGraphDiv(e),a,n],p=[e,n,a];if(E(e,n,a),n=Array.isArray(n)?n:[n],"undefined"==typeof a)for(a=[],i=0;i<n.length;i++)a.push(-n.length+i);for(a=Array.isArray(a)?a:[a],n=z(n,e.data.length-1),a=z(a,e.data.length-1),i=0;i<e.data.length;i++)-1===n.indexOf(i)&&l.push(e.data[i]);for(i=0;i<n.length;i++)s.push({newIndex:a[i],trace:e.data[n[i]]});for(s.sort((function(t,e){return t.newIndex-e.newIndex})),i=0;i<s.length;i+=1)l.splice(s[i].newIndex,0,s[i].trace);e.data=l;var h=r.redraw(e);return c.add(e,u,d,f,p),h},r.prependTraces=function t(e,n,a,i){function l(t,e,r){var n,a;if(o.isTypedArray(t))if(r<=0){var i=new t.constructor(0),l=R(e,t);r<0?(n=l,a=i):(n=i,a=l)}else if(n=new t.constructor(r),a=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),a.set(t);else if(r<e.length){var s=e.length-r;n.set(e.subarray(0,s)),a.set(e.subarray(s)),a.set(t,s)}else{var c=r-e.length;n.set(e),n.set(t.subarray(0,c),e.length),a.set(t.subarray(c))}else n=e.concat(t),a=r>=0&&r<n.length?n.splice(r,n.length):[];return[n,a]}var s=I(e=o.getGraphDiv(e),n,a,i,l),u=r.redraw(e),f=[e,s.update,a,s.maxPoints];return c.add(e,r.extendTraces,f,t,arguments),u},r.newPlot=function(t,e,n,a){return t=o.getGraphDiv(t),d.cleanPlot([],{},t._fullData||[],t._fullLayout||{}),d.purge(t),r.plot(t,e,n,a)},r.plot=function(t,e,a,i){var l;if(t=o.getGraphDiv(t),s.init(t),o.isPlainObject(e)){var c=e;e=c.data,a=c.layout,i=c.config,l=c.frames}if(!1===s.triggerHandler(t,"plotly_beforeplot",[e,a,i]))return Promise.reject();e||a||o.isPlotDiv(t)||o.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),D(t,i),a||(a={}),n.select(t).classed("js-plotly-plot",!0),g.makeTester(),Array.isArray(t._promises)||(t._promises=[]);var f=0===(t.data||[]).length&&Array.isArray(e);Array.isArray(e)&&(T.cleanData(e),f?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!f||(t.layout=T.cleanLayout(a)),d.supplyDefaults(t);var v=t._fullLayout,y=v._has("cartesian");if(!v._has("polar")&&e&&e[0]&&e[0].r)return o.log("Legacy polar charts are deprecated!"),function(t,e,r){var a=n.select(t).selectAll(".plot-container").data([0]);a.enter().insert("div",":first-child").classed("plot-container plotly",!0);var i=a.selectAll(".svg-container").data([0]);i.enter().append("div").classed("svg-container",!0).style("position","relative"),i.html(""),e&&(t.data=e);r&&(t.layout=r);p.manager.fillLayout(t),i.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=p.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var l=t.framework.svg(),s=1,c=t._fullLayout.title?t._fullLayout.title.text:"";""!==c&&c||(s=0);var u=function(){this.call(x.convertToTspans,t)},f=l.select(".title-group text").call(u);if(t._context.edits.titleText){var h=o._(t,"Click to enter Plot title");c&&c!==h||(s=.2,f.attr({"data-unformatted":h}).text(h).style({opacity:s}).on("mouseover.opacity",(function(){n.select(this).transition().duration(100).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(1e3).style("opacity",0)})));var g=function(){this.call(x.makeEditable,{gd:t}).on("edit",(function(e){t.framework({layout:{title:{text:e}}}),this.text(e).call(u),this.call(g)})).on("cancel",(function(){var t=this.attr("data-unformatted");this.text(t).call(u)}))};f.call(g)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),d.addLinks(t),Promise.resolve()}(t,e,a);v._replotting=!0,(f||v._shouldCreateBgLayer)&&(st(t),v._shouldCreateBgLayer&&delete v._shouldCreateBgLayer),t.framework!==st&&(t.framework=st,st(t)),g.initGradients(t),f&&h.saveShowSpikeInitial(t);var b=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;b&&d.doCalcdata(t);for(var _=0;_<t.calcdata.length;_++)t.calcdata[_][0].trace=t._fullData[_];t._context.responsive?t._responsiveChartHandler||(t._responsiveChartHandler=function(){o.isHidden(t)||d.resize(t)},window.addEventListener("resize",t._responsiveChartHandler)):o.clearResponsive(t);var w=o.extendFlat({},v._size),M=0;function A(){if(d.clearAutoMarginIds(t),k.drawMarginPushers(t),h.allowAutoMargin(t),v._has("pie"))for(var e=t._fullData,r=0;r<e.length;r++){var n=e[r];"pie"===n.type&&n.automargin&&d.allowAutoMargin(t,"pie."+n.uid+".automargin")}return d.doAutoMargin(t),d.previousPromises(t)}function L(){t._transitioning||(k.doAutoRangeAndConstraints(t),f&&h.saveRangeInitial(t),u.getComponentMethod("rangeslider","calcAutorange")(t))}var C=[d.previousPromises,function(){if(l)return r.addFrames(t,l)},function e(){for(var r=v._basePlotModules,n=0;n<r.length;n++)r[n].drawFramework&&r[n].drawFramework(t);if(!v._glcanvas&&v._has("gl")&&(v._glcanvas=v._glcontainer.selectAll(".gl-canvas").data([{key:"contextLayer",context:!0,pick:!1},{key:"focusLayer",context:!1,pick:!1},{key:"pickLayer",context:!1,pick:!0}],(function(t){return t.key})),v._glcanvas.enter().append("canvas").attr("class",(function(t){return"gl-canvas gl-canvas-"+t.key.replace("Layer","")})).style({position:"absolute",top:0,left:0,overflow:"visible","pointer-events":"none"})),v._glcanvas){v._glcanvas.attr("width",v.width).attr("height",v.height);var a=v._glcanvas.data()[0].regl;if(a&&(Math.floor(v.width)!==a._gl.drawingBufferWidth||Math.floor(v.height)!==a._gl.drawingBufferHeight)){var i="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(!M)return o.log(i+" Clearing graph and plotting again."),d.cleanPlot([],{},t._fullData,v),d.supplyDefaults(t),v=t._fullLayout,d.doCalcdata(t),M++,e();o.error(i)}}return"h"===v.modebar.orientation?v._modebardiv.style("height",null).style("width","100%"):v._modebardiv.style("width",null).style("height",v.height+"px"),d.previousPromises(t)},A,function(){if(d.didMarginChange(w,v._size))return o.syncOrAsync([A,k.layoutStyles],t)}];y&&C.push((function(){if(b)return o.syncOrAsync([u.getComponentMethod("shapes","calcAutorange"),u.getComponentMethod("annotations","calcAutorange"),L],t);L()})),C.push(k.layoutStyles),y&&C.push((function(){return h.draw(t,f?"":"redraw")}),(function(t){t._fullLayout._insideTickLabelsAutorange&&V(t,t._fullLayout._insideTickLabelsAutorange).then((function(){t._fullLayout._insideTickLabelsAutorange=void 0}))})),C.push(k.drawData,k.finalDraw,m,d.addLinks,d.rehover,d.redrag,d.doAutoMargin,(function(t){t._fullLayout._insideTickLabelsAutorange&&f&&h.saveRangeInitial(t,!0)}),d.previousPromises);var O=o.syncOrAsync(C,t);return O&&O.then||(O=Promise.resolve()),O.then((function(){return S(t),t}))},r.purge=function(t){var e=(t=o.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return d.cleanPlot([],{},r,e),d.purge(t),s.purge(t),e._container&&e._container.remove(),delete t._context,t},r.react=function(t,e,n,a){var i,s;t=o.getGraphDiv(t),T.clearPromiseQueue(t);var c=t._fullData,p=t._fullLayout;if(o.isPlotDiv(t)&&c&&p){if(o.isPlainObject(e)){var h=e;e=h.data,n=h.layout,a=h.config,i=h.frames}var g=!1;if(a){var v=o.extendDeep({},t._context);t._context=void 0,D(t,a),g=function t(e,r){var n;for(n in e)if("_"!==n.charAt(0)){var a=e[n],i=r[n];if(a!==i)if(o.isPlainObject(a)&&o.isPlainObject(i)){if(t(a,i))return!0}else{if(!Array.isArray(a)||!Array.isArray(i))return!0;if(a.length!==i.length)return!0;for(var l=0;l<a.length;l++)if(a[l]!==i[l]){if(!o.isPlainObject(a[l])||!o.isPlainObject(i[l]))return!0;if(t(a[l],i[l]))return!0}}}}(v,t._context)}t.data=e||[],T.cleanData(t.data),t.layout=n||{},T.cleanLayout(t.layout),function(t,e,r,n){var a,i,s,c,u,f,d,p,h=n._preGUI,g=[],v={};for(a in h){if(u=et(a,K)){if(i=u.attr||u.head+".uirevision",(c=(s=l(n,i).get())&&rt(i,e))&&c===s&&(null===(f=h[a])&&(f=void 0),it(p=(d=l(e,a)).get(),f))){void 0===p&&"autorange"===a.substr(a.length-9)&&g.push(a.substr(0,a.length-10)),d.set(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(e,y).get();x&&delete x.autorange}}var b=n._tracePreGUI;for(var _ in b){var w,T=b[_],k=null;for(a in T){if(!k){var M=nt(_,r);if(M<0){delete b[_];break}var A=at(_,t,(w=r[M]._fullInput).index);if(A<0){delete b[_];break}k=t[A]}if(u=et(a,tt)){if(u.attr?c=(s=l(n,u.attr).get())&&rt(u.attr,e):(s=w.uirevision,void 0===(c=k.uirevision)&&(c=e.uirevision)),c&&c===s&&(null===(f=T[a])&&(f=void 0),it(p=(d=l(k,a)).get(),f))){d.set(N(l(w,a).get()));continue}}else o.warn("unrecognized GUI edit: "+a+" in trace uid "+_);delete T[a]}}}(t.data,t.layout,c,p),d.supplyDefaults(t,{skipUpdateCalc:!0});var m=t._fullData,y=t._fullLayout,x=void 0===y.datarevision,b=y.transition,_=function(t,e,r,n,a){var i=M.layoutFlags();function o(t){return f.getLayoutValObject(r,t)}i.arrays={},i.rangesAltered={},i.nChanges=0,i.nChangesAnim=0,ot(e,r,[],{getValObject:o,flags:i,immutable:n,transition:a,gd:t}),(i.plot||i.calc)&&(i.layoutReplot=!0);a&&i.nChanges&&i.nChangesAnim&&(i.anim=i.nChanges===i.nChangesAnim?"all":"some");return i}(t,p,y,x,b),w=_.newDataRevision,A=function(t,e,r,n,a,i){var o=e.length===r.length;if(!a&&!o)return{fullReplot:!0,calc:!0};var l,s,c=M.traceFlags();c.arrays={},c.nChanges=0,c.nChangesAnim=0;var u={getValObject:function(t){var e=f.getTraceValObject(s,t);return!s._module.animatable&&e.anim&&(e.anim=!1),e},flags:c,immutable:n,transition:a,newDataRevision:i,gd:t},p={};for(l=0;l<e.length;l++)if(r[l]){if(s=r[l]._fullInput,d.hasMakesDataTransform(s)&&(s=r[l]),p[s.uid])continue;p[s.uid]=1,ot(e[l]._fullInput,s,[],u)}(c.calc||c.plot)&&(c.fullReplot=!0);a&&c.nChanges&&c.nChangesAnim&&(c.anim=c.nChanges===c.nChangesAnim&&o?"all":"some");return c}(t,c,m,x,b,w);if(Q(t)&&(_.layoutReplot=!0),A.calc||_.calc){t.calcdata=void 0;for(var L=Object.getOwnPropertyNames(y),C=0;C<L.length;C++){var O=L[C],z=O.substring(0,5);if("xaxis"===z||"yaxis"===z){var P=y[O]._emptyCategories;P&&P()}}}else d.supplyDefaultsUpdateCalc(t.calcdata,m);var E=[];if(i&&(t._transitionData={},d.createTransitionData(t),E.push((function(){return r.addFrames(t,i)}))),y.transition&&!g&&(A.anim||_.anim))_.ticks&&E.push(k.doTicksRelayout),d.doCalcdata(t),k.doAutoRangeAndConstraints(t),E.push((function(){return d.transitionFromReact(t,A,_,p)}));else if(A.fullReplot||_.layoutReplot||g)t._fullLayout._skipDefaults=!0,E.push(r.plot);else{for(var I in _.arrays){var R=_.arrays[I];if(R.length){var F=u.getComponentMethod(I,"drawOne");if(F!==o.noop)for(var B=0;B<R.length;B++)F(t,R[B]);else{var H=u.getComponentMethod(I,"draw");if(H===o.noop)throw new Error("cannot draw components: "+I);H(t)}}}E.push(d.previousPromises),A.style&&E.push(k.doTraceStyle),(A.colorbars||_.colorbars)&&E.push(k.doColorBars),_.legend&&E.push(k.doLegend),_.layoutstyle&&E.push(k.layoutStyles),_.axrange&&G(E),_.ticks&&E.push(k.doTicksRelayout),_.modebar&&E.push(k.doModeBar),_.camera&&E.push(k.doCamera),E.push(S)}E.push(d.rehover,d.redrag),(s=o.syncOrAsync(E,t))&&s.then||(s=Promise.resolve(t))}else s=r.newPlot(t,e,n,a);return s.then((function(){return t.emit("plotly_react",{data:e,layout:n}),t}))},r.redraw=function(t){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return T.cleanData(t.data),T.cleanLayout(t.layout),t.calcdata=void 0,r.plot(t).then((function(){return t.emit("plotly_redraw"),t}))},r.relayout=V,r.restyle=F,r.setPlotConfig=function(t){return o.extendFlat(_,t)},r.update=J,r._guiRelayout=$(V),r._guiRestyle=$(F),r._guiUpdate=$(J),r._storeDirectGUIEdit=function(t,e,r){for(var n in r){H(n,l(t,n).get(),r[n],e)}}},{"../components/color":105,"../components/drawing":127,"../constants/xmlns_namespaces":213,"../lib":233,"../lib/events":226,"../lib/queue":248,"../lib/svg_text_utils":255,"../plots/cartesian/axes":279,"../plots/cartesian/constants":285,"../plots/cartesian/graph_interact":288,"../plots/cartesian/select":298,"../plots/plots":313,"../plots/polar/legacy":316,"../registry":326,"./edit_types":261,"./helpers":262,"./manage_arrays":264,"./plot_config":266,"./plot_schema":267,"./subroutines":269,d3:21,"fast-isnumeric":23,"has-hover":54}],266:[function(t,e,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 t(e,r){for(var n in e){var a=e[n];a.valType?r[n]=a.dflt:(r[n]||(r[n]={}),t(a,r[n]))}}(n,a),e.exports={configAttributes:n,dfltConfig:a}},{}],267:[function(t,e,r){"use strict";var n=t("../registry"),a=t("../lib"),i=t("../plots/attributes"),o=t("../plots/layout_attributes"),l=t("../plots/frame_attributes"),s=t("../plots/animation_attributes"),c=t("./plot_config").configAttributes,u=t("../plots/polar/legacy/area_attributes"),f=t("../plots/polar/legacy/axis_attributes"),d=t("./edit_types"),p=a.extendFlat,h=a.extendDeepAll,g=a.isPlainObject,v=a.isArrayOrTypedArray,m=a.nestedProperty,y=a.valObjectMeta,x=["_isSubplotObj","_isLinkedToArray","_arrayAttrRegexps","_deprecated"];function b(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(_(e[r]))r++;else if(r<e.length)return!1;for(;r<e.length;r++){var n=t[e[r]];if(!g(n))break;if(t=n,r===e.length-1)break;if(t._isLinkedToArray){if(!_(e[++r]))return!1}else if("info_array"===t.valType){var a=e[++r];if(!_(a))return!1;var i=t.items;if(Array.isArray(i)){if(a>=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!_(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function _(t){return t===Math.round(t)&&t>=0}function w(){var t,e,r={};for(t in h(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a<e.attr.length;a++)M(r,e,e.attr[a]);else M(r,e,"subplot"===e.attr?e.name:e.attr)}for(t in r=function(t){return p(t,{radialaxis:f.radialaxis,angularaxis:f.angularaxis}),p(t,f.layout),t}(r),n.componentsRegistry){var i=(e=n.componentsRegistry[t]).schema;if(i&&(i.subplots||i.layout)){var l=i.subplots;if(l&&l.xaxis&&!l.yaxis)for(var s in l.xaxis)delete r.yaxis[s]}else"colorscale"===e.name?h(r,e.layoutAttributes):e.layoutAttributes&&A(r,e.layoutAttributes,e.name)}return{layoutAttributes:k(r)}}function T(){var t={frames:h({},l)};return k(t),t.frames}function k(t){return function(t){r.crawl(t,(function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):g(t)&&(t.role="object")}))}(t),function(t){r.crawl(t,(function(t,e,r){if(t){var n=t._isLinkedToArray;n&&(delete t._isLinkedToArray,r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}))}(t),function(t){!function t(e){for(var r in e)if(g(e[r]))t(e[r]);else if(Array.isArray(e[r]))for(var n=0;n<e[r].length;n++)t(e[r][n]);else e[r]instanceof RegExp&&(e[r]=e[r].toString())}(t)}(t),t}function M(t,e,r){var n=m(t,r),a=h({},e.layoutAttributes);a._isSubplotObj=!0,n.set(a)}function A(t,e,r){var n=m(t,r);n.set(h(n.get()||{},e))}r.IS_SUBPLOT_OBJ="_isSubplotObj",r.IS_LINKED_TO_ARRAY="_isLinkedToArray",r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=x,r.get=function(){var t={};n.allTypes.concat("area").forEach((function(e){t[e]=function(t){var e,a;"area"===t?(e={attributes:u},a={}):(e=n.modules[t]._module,a=e.basePlotModule);var o={type:null},l=h({},i),s=h({},e.attributes);r.crawl(s,(function(t,e,r,n,a){m(l,a).set(void 0),void 0===t&&m(s,a).set(void 0)})),h(o,l),n.traceIs(t,"noOpacity")&&delete o.opacity;n.traceIs(t,"showLegend")||(delete o.showlegend,delete o.legendgroup);n.traceIs(t,"noHover")&&(delete o.hoverinfo,delete o.hoverlabel);e.selectPoints||delete o.selectedpoints;h(o,s),a.attributes&&h(o,a.attributes);o.type=t;var c={meta:e.meta||{},categories:e.categories||{},animatable:Boolean(e.animatable),type:t,attributes:k(o)};if(e.layoutAttributes){var f={};h(f,e.layoutAttributes),c.layoutAttributes=k(f)}e.animatable||r.crawl(c,(function(t){r.isValObject(t)&&"anim"in t&&delete t.anim}));return c}(e)}));var e={};return Object.keys(n.transformsRegistry).forEach((function(t){e[t]=function(t){var e=n.transformsRegistry[t],r=h({},e.attributes);return Object.keys(n.componentsRegistry).forEach((function(e){var a=n.componentsRegistry[e];a.schema&&a.schema.transforms&&a.schema.transforms[t]&&Object.keys(a.schema.transforms[t]).forEach((function(e){A(r,a.schema.transforms[t][e],e)}))})),{attributes:k(r)}}(t)})),{defs:{valObjects:y,metaKeys:x.concat(["description","role","editType","impliedEdits"]),editType:{traces:d.traces,layout:d.layout},impliedEdits:{}},traces:t,layout:w(),transforms:e,frames:T(),animation:k(s),config:k(c)}},r.crawl=function(t,e,n,a){var i=n||0;a=a||"",Object.keys(t).forEach((function(n){var o=t[n];if(-1===x.indexOf(n)){var l=(a?a+".":"")+n;e(o,n,t,i,l),r.isValObject(o)||g(o)&&"impliedEdits"!==n&&r.crawl(o,e,i+1,l)}}))},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){var e,n,a=[],o=[],l=[];function s(t,r,i,s){o=o.slice(0,s).concat([r]),l=l.slice(0,s).concat([t&&t._isLinkedToArray]),t&&("data_array"===t.valType||!0===t.arrayOk)&&!("colorbar"===o[s-1]&&("ticktext"===r||"tickvals"===r))&&function t(e,r,i){var s=e[o[r]],c=i+o[r];if(r===o.length-1)v(s)&&a.push(n+c);else if(l[r]){if(Array.isArray(s))for(var u=0;u<s.length;u++)g(s[u])&&t(s[u],r+1,c+"["+u+"].")}else g(s)&&t(s,r+1,c+".")}(e,0,"")}e=t,n="",r.crawl(i,s),t._module&&t._module.attributes&&r.crawl(t._module.attributes,s);var c=t.transforms;if(c)for(var u=0;u<c.length;u++){var f=c[u],d=f._module;d&&(n="transforms["+u+"].",e=f,r.crawl(d.attributes,s))}return a},r.getTraceValObject=function(t,e){var r,a,o=e[0],l=1;if("transforms"===o){if(1===e.length)return i.transforms;var s=t.transforms;if(!Array.isArray(s)||!s.length)return!1;var c=e[1];if(!_(c)||c>=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[e[2]],l=3}else if("area"===t.type)a=u[o];else{var f=t._module;if(f||(f=(n.modules[t.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var d=f.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return b(a,e,l)},r.getLayoutValObject=function(t,e){return b(function(t,e){var r,a,i,l,s=t._basePlotModules;if(s){var c;for(r=0;r<s.length;r++){if((i=s[r]).attrRegex&&i.attrRegex.test(e)){if(i.layoutAttrOverrides)return i.layoutAttrOverrides;!c&&i.layoutAttributes&&(c=i.layoutAttributes)}var u=i.baseLayoutAttrOverrides;if(u&&e in u)return u[e]}if(c)return c}var d=t._modules;if(d)for(r=0;r<d.length;r++)if((l=d[r].layoutAttributes)&&e in l)return l[e];for(a in n.componentsRegistry){if("colorscale"===(i=n.componentsRegistry[a]).name&&0===e.indexOf("coloraxis"))return i.layoutAttributes[e];if(!i.schema&&e===i.name)return i.layoutAttributes}if(e in o)return o[e];if("radialaxis"===e||"angularaxis"===e)return f[e];return f.layout[e]||!1}(t,e[0]),e,1)}},{"../lib":233,"../plots/animation_attributes":273,"../plots/attributes":275,"../plots/frame_attributes":308,"../plots/layout_attributes":311,"../plots/polar/legacy/area_attributes":314,"../plots/polar/legacy/axis_attributes":315,"../registry":326,"./edit_types":261,"./plot_config":266}],268:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/attributes"),i={name:{valType:"string",editType:"none"}};function o(t){return t&&"string"==typeof t}function l(t){var e=t.length-1;return"s"!==t.charAt(e)&&n.warn("bad argument to arrayDefaultKey: "+t),t.substr(0,t.length-1)+"defaults"}i.templateitemname={valType:"string",editType:"calc"},r.templatedArray=function(t,e){return e._isLinkedToArray=t,e.name=i.name,e.templateitemname=i.templateitemname,e},r.traceTemplater=function(t){var e,r,i={};for(e in t)r=t[e],Array.isArray(r)&&r.length&&(i[e]=0);return{newTrace:function(o){var l={type:e=n.coerce(o,{},a,"type"),_template:null};if(e in i){r=t[e];var s=i[e]%r.length;i[e]++,l._template=r[s]}return l}}},r.newContainer=function(t,e,r){var a=t._template,i=a&&(a[e]||r&&a[r]);return n.isPlainObject(i)||(i=null),t[e]={_template:i}},r.arrayTemplater=function(t,e,r){var n=t._template,a=n&&n[l(e)],i=n&&n[e];Array.isArray(i)&&i.length||(i=[]);var s={};return{newItem:function(t){var e={name:t.name,_input:t},n=e.templateitemname=t.templateitemname;if(!o(n))return e._template=a,e;for(var l=0;l<i.length;l++){var c=i[l];if(c.name===n)return s[n]=1,e._template=c,e}return e[r]=t[r]||!1,e._template=!1,e},defaultItems:function(){for(var t=[],e=0;e<i.length;e++){var r=i[e],n=r.name;if(o(n)&&!s[n]){var a={_template:r,name:n,_input:{_templateitemname:n}};a.templateitemname=r.templateitemname,t.push(a),s[n]=1}}return t}}},r.arrayDefaultKey=l,r.arrayEditor=function(t,e,r){var a=(n.nestedProperty(t,e).get()||[]).length,i=r._index,o=i>=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=e+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(t,e){o?n.nestedProperty(l[s],t).set(e):l[s+"."+t]=e}function f(){var t=l;return c(),t}return c(),{modifyBase:function(t,e){l[t]=e},modifyItem:u,getUpdateObj:f,applyUpdate:function(e,r){e&&u(e,r);var a=f();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":233,"../plots/attributes":275}],269:[function(t,e,r){"use strict";var n=t("d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),l=t("../lib/clear_gl_canvases"),s=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),f=t("../components/modebar"),d=t("../plots/cartesian/axes"),p=t("../constants/alignment"),h=t("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,m=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n<r.length;n++){var a=r[n][0],i=r[n][1];if(!(a[0]>=t[1]||a[1]<=t[0])&&(i[0]<e[1]&&i[1]>e[0]))return!0}return!1}function x(t){var e,a,l,u,h,g,v=t._fullLayout,m=v._size,x=m.p,_=d.list(t,"",!0);if(v._paperdiv.style({width:t._context.responsive&&v.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":v.width+"px",height:t._context.responsive&&v.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(c.setSize,v.width,v.height),t._context.setBackground(t,v.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!v._has("cartesian"))return i.previousPromises(t);function T(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-x-n:e._offset+e._length+x+n:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+x+n:e._offset-x-n:m.l+m.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var k=(u=_[e])._anchorAxis;u._linepositions={},u._lw=c.crispRound(t,u.linewidth,1),u._mainLinePosition=T(u,k,u.side),u._mainMirrorPosition=u.mirror&&k?T(u,k,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,D=l.plotgroup;if(y(C,O,L)){var z=D.node(),P=l.bg=o.ensureSingle(D,"rect","bg");z.insertBefore(P.node(),z.childNodes[0]),A.push(a)}else D.select("rect.bg").remove(),L.push([C,O]),S||(M.push(a),A.push(a))}var E,I,R,F,N,B,H,j,U,V,q,G,Z,Y=v._bgLayer.selectAll(".bg").data(M);for(Y.enter().append("rect").classed("bg",!0),Y.exit().remove(),Y.each((function(t){v._plots[t].bg=n.select(this)})),e=0;e<A.length;e++)l=v._plots[A[e]],h=l.xaxis,g=l.yaxis,l.bg&&void 0!==h._offset&&void 0!==g._offset&&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 X,W,Q=l.clipId="clip"+v._uid+a+"plot",J=o.ensureSingleById(v._clips,"clipPath",Q,(function(t){t.classed("plotclip",!0).append("rect")}));l.clipRect=J.select("rect").attr({width:h._length,height:g._length}),c.setTranslate(l.plot,h._offset,g._offset),l._hasClipOnAxisFalse?(X=null,W=Q):(X=Q,W=null),c.setClipUrl(l.plot,X,t),l.layerClipId=W}function $(t){return"M"+E+","+t+"H"+I}function K(t){return"M"+h._offset+","+t+"h"+h._length}function tt(t){return"M"+t+","+j+"V"+H}function et(t){return"M"+t+","+g._offset+"v"+g._length}function rt(t,e,r){if(!t.showline||a!==t._mainSubplot)return"";if(!t._anchorAxis)return r(t._mainLinePosition);var n=e(t._mainLinePosition);return t.mirror&&(n+=e(t._mainMirrorPosition)),n}for(a in v._plots){l=v._plots[a],h=l.xaxis,g=l.yaxis;var nt="M0,0";b(h,a)&&(N=w(h,"left",g,_),E=h._offset-(N?x+N:0),B=w(h,"right",g,_),I=h._offset+h._length+(B?x+B:0),R=T(h,g,"bottom"),F=T(h,g,"top"),!(Z=!h._anchorAxis||a!==h._mainSubplot)||"allticks"!==h.mirror&&"all"!==h.mirror||(h._linepositions[a]=[R,F]),nt=rt(h,$,K),Z&&h.showline&&("all"===h.mirror||"allticks"===h.mirror)&&(nt+=$(R)+$(F)),l.xlines.style("stroke-width",h._lw+"px").call(s.stroke,h.showline?h.linecolor:"rgba(0,0,0,0)")),l.xlines.attr("d",nt);var at="M0,0";b(g,a)&&(q=w(g,"bottom",h,_),H=g._offset+g._length+(q?x:0),G=w(g,"top",h,_),j=g._offset-(G?x:0),U=T(g,h,"left"),V=T(g,h,"right"),!(Z=!g._anchorAxis||a!==g._mainSubplot)||"allticks"!==g.mirror&&"all"!==g.mirror||(g._linepositions[a]=[U,V]),at=rt(g,tt,et),Z&&g.showline&&("all"===g.mirror||"allticks"===g.mirror)&&(at+=tt(U)+tt(V)),l.ylines.style("stroke-width",g._lw+"px").call(s.stroke,g.showline?g.linecolor:"rgba(0,0,0,0)")),l.ylines.attr("d",at)}return d.makeClipPaths(t),i.previousPromises(t)}function b(t,e){return(t.ticks||t.showline)&&(e===t._mainSubplot||"all"===t.mirror||"allticks"===t.mirror)}function _(t,e,r){if(!r.showline||!r._lw)return!1;if("all"===r.mirror||"allticks"===r.mirror)return!0;var n=r._anchorAxis;if(!n)return!1;var a=p.FROM_BL[e];return r.side===e?n.domain[a]===t.domain[a]:r.mirror&&n.domain[1-a]===t.domain[1-a]}function w(t,e,r,n){if(_(t,e,r))return r._lw;for(var a=0;a<n.length;a++){var i=n[a];if(i._mainAxis===r._mainAxis&&_(t,e,i))return i._lw}return 0}function T(t,e){var r=t.title,n=t._size,a=0;switch("start"===e?a=r.pad.l:"end"===e&&(a=-r.pad.r),r.xref){case"paper":return n.l+n.w*r.x+a;case"container":default:return t.width*r.x+a}}function k(t,e){var r=t.title,n=t._size,a=0;if("0em"!==e&&e?e===p.CAP_SHIFT+"em"&&(a=r.pad.t):a=-r.pad.b,"auto"===r.y)return n.t/2;switch(r.yref){case"paper":return n.t+n.h-n.h*r.y+a;case"container":default:return t.height-t.height*r.y+a}}r.layoutStyles=function(t){return o.syncOrAsync([i.doAutoMargin,x],t)},r.drawMainTitle=function(t){var e=t._fullLayout,r=function(t){var e=t.title,r="middle";o.isRightAnchor(e)?r="end":o.isLeftAnchor(e)&&(r="start");return r}(e),n=function(t){var e=t.title,r="0em";o.isTopAnchor(e)?r=p.CAP_SHIFT+"em":o.isMiddleAnchor(e)&&(r=p.MID_SHIFT+"em");return r}(e);u.draw(t,"gtitle",{propContainer:e,propName:"title.text",placeholder:e._dfltTitle.plot,attributes:{x:T(e,r),y:k(e,n),"text-anchor":r,dy:n}})},r.doTraceStyle=function(t){var e,n=t.calcdata,o=[];for(e=0;e<n.length;e++){var s=n[e],c=s[0]||{},u=c.trace||{},f=u._module||{},d=f.arraysToCalcdata;d&&d(s,u);var p=f.editStyle;p&&o.push({fn:p,cd0:c})}if(o.length){for(e=0;e<o.length;e++){var h=o[e];h.fn(t,h.cd0)}l(t),r.redrawReglTraces(t)}return i.style(t),a.getComponentMethod("legend","draw")(t),i.previousPromises(t)},r.doColorBars=function(t){return a.getComponentMethod("colorbar","draw")(t),i.previousPromises(t)},r.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,a.call("plot",t,"",e)},r.doLegend=function(t){return a.getComponentMethod("legend","draw")(t),i.previousPromises(t)},r.doTicksRelayout=function(t){return d.draw(t,"redraw"),t._fullLayout._hasOnlyLargeSploms&&(a.subplotsRegistry.splom.updateGrid(t),l(t),r.redrawReglTraces(t)),r.drawMainTitle(t),i.previousPromises(t)},r.doModeBar=function(t){var e=t._fullLayout;f.manage(t);for(var r=0;r<e._basePlotModules.length;r++){var n=e._basePlotModules[r].updateFx;n&&n(t)}return i.previousPromises(t)},r.doCamera=function(t){for(var e=t._fullLayout,r=e._subplots.gl3d,n=0;n<r.length;n++){var a=e[r[n]];a._scene.setViewport(a)}},r.drawData=function(t){var e=t._fullLayout;l(t);for(var n=e._basePlotModules,o=0;o<n.length;o++)n[o].plot(t);return r.redrawReglTraces(t),i.style(t),a.getComponentMethod("shapes","draw")(t),a.getComponentMethod("annotations","draw")(t),a.getComponentMethod("images","draw")(t),e._replotting=!1,i.previousPromises(t)},r.redrawReglTraces=function(t){var e=t._fullLayout;if(e._has("regl")){var r,n,a=t._fullData,i=[],l=[];for(e._hasOnlyLargeSploms&&e._splomGrid.draw(),r=0;r<a.length;r++){var s=a[r];!0===s.visible&&0!==s._length&&("splom"===s.type?e._splomScenes[s.uid].draw():"scattergl"===s.type?o.pushUnique(i,s.xaxis+s.yaxis):"scatterpolargl"===s.type&&o.pushUnique(l,s.subplot))}for(r=0;r<i.length;r++)(n=e._plots[i[r]])._scene&&n._scene.draw();for(r=0;r<l.length;r++)(n=e[l[r]]._subplot)._scene&&n._scene.draw()}},r.doAutoRangeAndConstraints=function(t){for(var e,r=d.list(t,"",!0),n={},a=0;a<r.length;a++)if(!n[(e=r[a])._id]){n[e._id]=1,v(t,e),m(t,e);var i=e._matchGroup;if(i)for(var o in i){var l=d.getFromId(t,o);m(t,l,e.range),n[o]=1}}g(t)},r.finalDraw=function(t){a.getComponentMethod("rangeslider","draw")(t),a.getComponentMethod("rangeselector","draw")(t)},r.drawMarginPushers=function(t){a.getComponentMethod("legend","draw")(t),a.getComponentMethod("rangeselector","draw")(t),a.getComponentMethod("sliders","draw")(t),a.getComponentMethod("updatemenus","draw")(t),a.getComponentMethod("colorbar","draw")(t)}},{"../components/color":105,"../components/drawing":127,"../components/modebar":165,"../components/titles":200,"../constants/alignment":207,"../lib":233,"../lib/clear_gl_canvases":221,"../plots/cartesian/autorange":278,"../plots/cartesian/axes":279,"../plots/cartesian/constraints":286,"../plots/plots":313,"../registry":326,d3:21}],270:[function(t,e,r){"use strict";var n=t("../lib"),a=n.isPlainObject,i=t("./plot_schema"),o=t("../plots/plots"),l=t("../plots/attributes"),s=t("./plot_template"),c=t("./plot_config").dfltConfig;function u(t,e){t=n.extendDeep({},t);var r,i,o=Object.keys(t).sort();function l(e,r,n){if(a(r)&&a(e))u(e,r);else if(Array.isArray(r)&&Array.isArray(e)){var o=s.arrayTemplater({_template:t},n);for(i=0;i<r.length;i++){var l=r[i],c=o.newItem(l)._template;c&&u(c,l)}var f=o.defaultItems();for(i=0;i<f.length;i++)r.push(f[i]._template);for(i=0;i<r.length;i++)delete r[i].templateitemname}}for(r=0;r<o.length;r++){var c=o[r],d=t[c];if(c in e?l(d,e[c],c):e[c]=d,f(c)===c)for(var p in e){var h=f(p);p===h||h!==c||p in t||l(d,e[p],c)}}}function f(t){return t.replace(/[0-9]+$/,"")}function d(t,e,r,i,o){var l=o&&r(o);for(var c in t){var u=t[c],p=g(t,c,i),h=g(t,c,o),v=r(h);if(!v){var m=f(c);m!==c&&(v=r(h=g(t,m,o)))}if((!l||l!==v)&&!(!v||v._noTemplating||"data_array"===v.valType||v.arrayOk&&Array.isArray(u)))if(!v.valType&&a(u))d(u,e,r,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 T=w.name;if(T)b[T]||(d(w,e,r,g(u,x,p),g(u,x,h)),x++,b[T]=1);else if(!y){var k=g(t,s.arrayDefaultKey(c),i),M=g(u,x,p);d(w,e,r,M,g(u,x,h));var A=n.nestedProperty(e,M);n.nestedProperty(e,k).set(A.get()),A.set(null),y=!0}}}else{n.nestedProperty(e,p).set(u)}}}function p(t,e){return i.getLayoutValObject(t,n.nestedProperty({},e).parts)}function h(t,e){return i.getTraceValObject(t,n.nestedProperty({},e).parts)}function g(t,e,r){return r?Array.isArray(t)?r+"["+e+"]":r+"."+e:e}function v(t){for(var e=0;e<t.length;e++)if(a(t[e]))return!0}function m(t){var e;switch(t.code){case"data":e="The template has no key data.";break;case"layout":e="The template has no key layout.";break;case"missing":e=t.path?"There are no templates for item "+t.path+" with name "+t.templateitemname:"There are no templates for trace "+t.index+", of type "+t.traceType+".";break;case"unused":e=t.path?"The template item at "+t.path+" was not used in constructing the plot.":t.dataCount?"Some of the templates of type "+t.traceType+" were not used. The template has "+t.templateCount+" traces, the data only has "+t.dataCount+" of this type.":"The template has "+t.templateCount+" traces of type "+t.traceType+" but there are none in the data.";break;case"reused":e="Some of the templates of type "+t.traceType+" were used more than once. The template has "+t.templateCount+" traces, the data has "+t.dataCount+" of this type."}return t.msg=e,t}r.makeTemplate=function(t){t=n.isPlainObject(t)?t:n.getGraphDiv(t),t=n.extendDeep({_context:c},{data:t.data,layout:t.layout}),o.supplyDefaults(t);var e=t.data||[],r=t.layout||{};r._basePlotModules=t._fullLayout._basePlotModules,r._modules=t._fullLayout._modules;var i={data:{},layout:{}};e.forEach((function(t){var e={};d(t,e,h.bind(null,t));var r=n.coerce(t,{},l,"type"),a=i.data[r];a||(a=i.data[r]=[]),a.push(e)})),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(t,e){var r=n.extendDeep({},{_context:c,data:t.data,layout:t.layout}),i=r.layout||{};a(e)||(e=i.template||{});var l=e.layout,s=e.data,u=[];r.layout=i,r.layout.template=e,o.supplyDefaults(r);var d=r._fullLayout,p=r._fullData,h={};if(a(l)?(!function t(e,r){for(var n in e)if("_"!==n.charAt(0)&&a(e[n])){var i,o=f(n),l=[];for(i=0;i<r.length;i++)l.push(g(e,n,r[i])),o!==n&&l.push(g(e,o,r[i]));for(i=0;i<l.length;i++)h[l[i]]=1;t(e[n],l)}}(d,["layout"]),function t(e,r){for(var n in e)if(-1===n.indexOf("defaults")&&a(e[n])){var i=g(e,n,r);h[i]?t(e[n],i):u.push({code:"unused",path:i})}}(l,"layout")):u.push({code:"layout"}),a(s)){for(var y,x={},b=0;b<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,T=x[y]||0;w>T?u.push({code:"unused",traceType:y,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=g(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&v(i)&&t(i,o)}}({data:p,layout:d},""),u.length)return u.map(m)}},{"../lib":233,"../plots/attributes":275,"../plots/plots":313,"./plot_config":266,"./plot_schema":267,"./plot_template":268}],271:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../plots/plots"),o=t("../lib"),l=t("../snapshot/helpers"),s=t("../snapshot/tosvg"),c=t("../snapshot/svgtoimg"),u=t("../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}};e.exports=function(t,e){var r,d,p,h;function g(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],d=t.layout||{},p=t.config||{},h={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),d=o.extendDeep({},t.layout),p=t._context,h=t._fullLayout||{}),!g("width")&&null!==e.width||!g("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var v={};function m(t,r){return o.coerce(e,v,f,t,r)}var y=m("format"),x=m("width"),b=m("height"),_=m("scale"),w=m("setBackground"),T=m("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var M=o.extendFlat({},d);x?M.width=x:null===e.width&&n(h.width)&&(M.width=h.width),b?M.height=b:null===e.height&&n(h.height)&&(M.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(k);function S(){return new Promise((function(t){setTimeout(t,l.getDelay(k._fullLayout))}))}function C(){return new Promise((function(t,e){var r=s(k,y,_),n=k._fullLayout.width,f=k._fullLayout.height;function d(){a.purge(k),document.body.removeChild(k)}if("full-json"===y){var p=i.graphJson(k,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),t(T?p:l.encodeJSON(p))}if(d(),"svg"===y)return t(T?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(t).catch(e)}))}return new Promise((function(t,e){a.plot(k,r,M,A).then(L).then(S).then(C).then((function(e){t(function(t){return T?t.replace(l.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":233,"../plots/plots":313,"../snapshot/helpers":330,"../snapshot/svgtoimg":332,"../snapshot/tosvg":334,"../version":494,"./plot_api":265,"fast-isnumeric":23}],272:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,a,i,o){o=o||[];for(var f=Object.keys(t),d=0;d<f.length;d++){var p=f[d];if("transforms"!==p){var m=o.slice();m.push(p);var y=t[p],x=e[p],b=v(r,p),_=(b||{}).valType,w="info_array"===_,T="colorscale"===_,k=(b||{}).items;if(g(r,p))if(l(y)&&l(x)&&"any"!==_)u(y,x,b,a,i,m);else if(w&&s(y)){y.length>x.length&&a.push(h("unused",i,m.concat(x.length)));var M,A,L,S,C,O=x.length,D=Array.isArray(k);if(D&&(O=Math.min(O,k.length)),2===b.dimensions)for(A=0;A<O;A++)if(s(y[A])){y[A].length>x[A].length&&a.push(h("unused",i,m.concat(A,x[A].length)));var z=x[A].length;for(M=0;M<(D?Math.min(z,k[A].length):z);M++)L=D?k[A][M]:k,S=y[A][M],C=x[A][M],n.validate(S,L)?C!==S&&C!==+S&&a.push(h("dynamic",i,m.concat(A,M),S,C)):a.push(h("value",i,m.concat(A,M),S))}else a.push(h("array",i,m.concat(A),y[A]));else for(A=0;A<O;A++)L=D?k[A]:k,S=y[A],C=x[A],n.validate(S,L)?C!==S&&C!==+S&&a.push(h("dynamic",i,m.concat(A),S,C)):a.push(h("value",i,m.concat(A),S))}else if(b.items&&!w&&s(y)){var P,E,I=k[Object.keys(k)[0]],R=[];for(P=0;P<x.length;P++){var F=x[P]._index||P;if((E=m.slice()).push(F),l(y[F])&&l(x[P])){R.push(F);var N=y[F],B=x[P];l(N)&&!1!==N.visible&&!1===B.visible?a.push(h("invisible",i,E)):u(N,B,I,a,i,E)}}for(P=0;P<y.length;P++)(E=m.slice()).push(P),l(y[P])?-1===R.indexOf(P)&&a.push(h("unused",i,E)):a.push(h("object",i,E,y[P]))}else!l(y)&&l(x)?a.push(h("object",i,m,y)):c(y)||!c(x)||w||T?p in e?n.validate(y,b)?"enumerated"===b.valType&&(b.coerceNumber&&y!==+x||y!==x)&&a.push(h("dynamic",i,m,y,x)):a.push(h("value",i,m,y)):a.push(h("unused",i,m,y)):a.push(h("array",i,m,y));else a.push(h("schema",i,m))}}return a}function f(t,e){for(var r=t.layout.layoutAttributes,a=0;a<e.length;a++){var i=e[a],o=t.traces[i.type],l=o.layoutAttributes;l&&(i.subplot?n.extendFlat(r[o.attributes.subplot.dflt],l):n.extendFlat(r,l))}return r}e.exports=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={});var r,c,d=i.get(),p=[],g={_context:n.extendFlat({},o)};s(t)?(g.data=n.extendDeep([],t),r=t):(g.data=[],r=[],p.push(h("array","data"))),l(e)?(g.layout=n.extendDeep({},e),c=e):(g.layout={},c={},arguments.length>1&&p.push(h("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y<m;y++){var x=r[y],b=["data",y];if(l(x)){var _=v[y],w=_.type,T=d.traces[w].attributes;T.type={valType:"enumerated",values:[w]},!1===_.visible&&!1!==x.visible&&p.push(h("invisible",b)),u(x,_,T,p,b);var k=x.transforms,M=_.transforms;if(k){s(k)||p.push(h("array",b,["transforms"])),b.push("transforms");for(var A=0;A<k.length;A++){var L=["transforms",A],S=k[A].type;if(l(k[A])){var C=d.transforms[S]?d.transforms[S].attributes:{};C.type={valType:"enumerated",values:Object.keys(d.transforms)},u(k[A],M[A],C,p,b,L)}else p.push(h("object",b,L))}}}else p.push(h("object",b))}var O=g._fullLayout,D=f(d,v);return u(c,O,D,p,"layout"),0===p.length?void 0:p};var d={object:function(t,e){return("layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":p(t)+"key "+e)+" must be linked to an object container"},array:function(t,e){return("data"===t?"The data argument":p(t)+"key "+e)+" must be linked to an array container"},schema:function(t,e){return p(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=l(r)?"container":"key";return p(t)+n+" "+e+" did not get coerced"},dynamic:function(t,e,r,n){return[p(t)+"key",e,"(set to '"+r+"')","got reset to","'"+n+"'","during defaults."].join(" ")},invisible:function(t,e){return(e?p(t)+"item "+e:"Trace "+t[1])+" got defaulted to be not visible"},value:function(t,e,r){return[p(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}};function p(t){return s(t)?"In data trace "+t[1]+", ":"In "+t+", "}function h(t,e,r,a,i){var o,l;r=r||"",s(e)?(o=e[0],l=e[1]):(o=e,l=null);var c=function(t){if(!s(t))return String(t);for(var e="",r=0;r<t.length;r++){var n=t[r];"number"==typeof n?e=e.substr(0,e.length-1)+"["+n+"]":e+=n,r<t.length-1&&(e+=".")}return e}(r),u=d[t](e,c,a,i);return n.log(u),{code:t,container:o,trace:l,path:r,astr:c,msg:u}}function g(t,e){var r=y(e),n=r.keyMinusId,a=r.id;return!!(n in t&&t[n]._isSubplotObj&&a)||e in t}function v(t,e){return e in t?t[e]:t[y(e).keyMinusId]}var m=n.counterRegex("([a-z]+)");function y(t){var e=t.match(m);return{keyMinusId:e&&e[1],id:e&&e[2]}}},{"../lib":233,"../plots/plots":313,"./plot_config":266,"./plot_schema":267}],273:[function(t,e,r){"use strict";e.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}},{}],274:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plot_api/plot_template");e.exports=function(t,e,r){var i,o,l=r.name,s=r.inclusionAttr||"visible",c=e[l],u=n.isArrayOrTypedArray(t[l])?t[l]:[],f=e[l]=[],d=a.arrayTemplater(e,l,s);for(i=0;i<u.length;i++){var p=u[i];n.isPlainObject(p)?o=d.newItem(p):(o=d.newItem({}))[s]=!1,o._index=i,!1!==o[s]&&r.handleItemDefaults(p,o,e,r),f.push(o)}var h=d.defaultItems();for(i=0;i<h.length;i++)(o=h[i])._index=f.length,r.handleItemDefaults({},o,e,r,{}),f.push(o);if(n.isArrayOrTypedArray(c)){var g=Math.min(c.length,f.length);for(i=0;i<g;i++)n.relinkPrivateKeys(f[i],c[i])}return f}},{"../lib":233,"../plot_api/plot_template":268}],275:[function(t,e,r){"use strict";var n=t("../components/fx/attributes");e.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:n.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},transforms:{_isLinkedToArray:"transform",editType:"calc"},uirevision:{valType:"any",editType:"none"}}},{"../components/fx/attributes":136}],276:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=a.dateTime2ms,o=a.incrementMonth,l=t("../../constants/numerical").ONEAVGMONTH;e.exports=function(t,e,r,a){if("date"!==e.type)return a;var s=t[r+"periodalignment"];if(!s)return a;var c,u=t[r+"period"];if(n(u)){if((u=+u)<=0)return a}else if("string"==typeof u&&"M"===u.charAt(0)){var f=+u.substring(1);if(!(f>0&&Math.round(f)===f))return a;c=f}for(var d=e.calendar,p="start"===s,h="end"===s,g=t[r+"period0"],v=i(g,d)||0,m=[],y=a.length,x=0;x<y;x++){var b,_,w,T=a[x];if(c){for(b=Math.round((T-v)/(c*l)),w=o(v,c*b,d);w>T;)w=o(w,-c,d);for(;w<=T;)w=o(w,c,d);_=o(w,-c,d)}else{for(w=v+(b=Math.round((T-v)/u))*u;w>T;)w-=u;for(;w<=T;)w+=u;_=w-u}m[x]=p?_:h?w:(_+w)/2}return m}},{"../../constants/numerical":212,"../../lib":233,"fast-isnumeric":23}],277:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],278:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").FP_SAFE,o=t("../../registry"),l=t("./axis_ids"),s=l.getFromId,c=l.isLinked;function u(t,e){var r,n,i=[],o=t._fullLayout,l=d(o,e,0),s=d(o,e,1),c=p(t,e),u=c.min,h=c.max;if(0===u.length||0===h.length)return a.simpleMap(e.range,e.r2l);var g=u[0].val,v=h[0].val;for(r=1;r<u.length&&g===v;r++)g=Math.min(g,u[r].val);for(r=1;r<h.length&&g===v;r++)v=Math.max(v,h[r].val);var m=!1;if(e.range){var y=a.simpleMap(e.range,e.r2l);m=y[1]<y[0]}"reversed"===e.autorange&&(m=!0,e.autorange=!0);var x,b,_,w,T,k,M=e.rangemode,A="tozero"===M,L="nonnegative"===M,S=e._length,C=S/10,O=0;for(r=0;r<u.length;r++)for(x=u[r],n=0;n<h.length;n++)(k=(b=h[n]).val-x.val-f(e,x.val,b.val))>0&&((T=S-l(x)-s(b))>C?k/T>O&&(_=x,w=b,O=k/T):k/S>O&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},O=k/S));if(g===v){var D=g-1,z=g+1;if(A)if(0===g)i=[0,1];else{var P=(g>0?h:u).reduce((function(t,e){return Math.max(t,s(e))}),0),E=g/(1-Math.min(.5,P/S));i=g>0?[0,E]:[E,0]}else i=L?[Math.max(0,D),Math.max(1,z)]:[D,z]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):L&&(_.val-O*l(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),O=(w.val-_.val-f(e,x.val,b.val))/(S-l(_)-s(w)),i=[_.val-O*l(_),w.val+O*s(w)];return m&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function f(t,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}function d(t,e,r){var n=.05*e._length,i=e._anchorAxis||{};if(-1!==(e.ticklabelposition||"").indexOf("inside")||-1!==(i.ticklabelposition||"").indexOf("inside")){var o="reversed"===e.autorange;if(!o){var l=a.simpleMap(e.range,e.r2l);o=l[1]<l[0]}o&&(r=!r)}var s=0;return c(t,e._id)||(s=function(t,e){var r=0,n=t._anchorAxis||{};if(-1!==(n.ticklabelposition||"").indexOf("inside")&&(!e&&("left"===n.side||"bottom"===n.side)||e&&("top"===n.side||"right"===n.side))){var i="x"===t._id.charAt(0);if(n._vals){var o=a.deg2rad(n._tickAngles[n._id+"tick"]||0),l=Math.abs(Math.cos(o)),s=Math.abs(Math.sin(o));n._vals.forEach((function(t){if(t.bb){var e=6+t.bb.width,n=6+t.bb.height;r=Math.max(r,i?Math.max(e*l,n*s):Math.max(n*l,e*s))}}))}"inside"===n.ticks&&"inside"===n.ticklabelposition&&(r+=n.ticklen||0)}return r}(e,r)),n=Math.max(s,n),"domain"===e.constrain&&e._inputDomain&&(n*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(t){return t.nopad?0:t.pad+(t.extrapad?n:s)}}e.exports={getAutoRange:u,makePadFn:d,doAutoRange:function(t,e,r){if(e.setScale(),e.autorange){e.range=r?r.slice():u(t,e),e._r=e.range.slice(),e._rl=a.simpleMap(e._r,e.r2l);var n=e._input,i={};i[e._attr+".range"]=e.range,i[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,i),n.range=e.range.slice(),n.autorange=e.autorange}var l=e._anchorAxis;if(l&&l.rangeslider){var s=l.rangeslider[e._name];s&&"auto"===s.rangemode&&(s.range=u(t,e)),l._input.rangeslider[e._name]=a.extendFlat({},s)}},findExtremes:function(t,e,r){r||(r={});t._m||t.setScale();var a,o,l,s,c,u,f,d,p,v=[],y=[],x=e.length,b=r.padded||!1,_=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,T=!1,k=r.vpadLinearized||!1;function M(t){if(Array.isArray(t))return T=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var A=M((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),L=M((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=M(r.vpadplus||r.vpad),C=M(r.vpadminus||r.vpad);if(!T){if(d=1/0,p=-1/0,w)for(a=0;a<x;a++)(o=e[a])<d&&o>0&&(d=o),o>p&&o<i&&(p=o);else for(a=0;a<x;a++)(o=e[a])<d&&o>-i&&(d=o),o>p&&o<i&&(p=o);e=[d,p],x=2}var O={tozero:_,extrapad:b};function D(r){l=e[r],n(l)&&(u=A(r),f=L(r),k?(s=t.c2l(l)-C(r),c=t.c2l(l)+S(r)):(d=l-C(r),p=l+S(r),w&&d<p/10&&(d=p/10),s=t.c2l(d),c=t.c2l(p)),_&&(s=Math.min(0,s),c=Math.max(0,c)),m(s)&&h(v,s,f,O),m(c)&&g(y,c,u,O))}var z=Math.min(6,x);for(a=0;a<z;a++)D(a);for(a=x-1;a>=z;a--)D(a);return{min:v,max:y,opts:r}},concatExtremes:p};function p(t,e,r){var n,a,i,o=e._id,l=t._fullData,c=t._fullLayout,u=[],f=[];function d(t,e){for(n=0;n<e.length;n++){var r=t[e[n]],l=(r._extremes||{})[o];if(!0===r.visible&&l){for(a=0;a<l.min.length;a++)i=l.min[a],h(u,i.val,i.pad,{extrapad:i.extrapad});for(a=0;a<l.max.length;a++)i=l.max[a],g(f,i.val,i.pad,{extrapad:i.extrapad})}}}if(d(l,e._traceIndices),d(c.annotations||[],e._annIndices||[]),d(c.shapes||[],e._shapeIndices||[]),e._matchGroup&&!r)for(var v in e._matchGroup)if(v!==e._id){var m=s(t,v),y=p(t,m,!0),x=e._length/m._length;for(a=0;a<y.min.length;a++)i=y.min[a],h(u,i.val,i.pad*x,{extrapad:i.extrapad});for(a=0;a<y.max.length;a++)i=y.max[a],g(f,i.val,i.pad*x,{extrapad:i.extrapad})}return{min:u,max:f}}function h(t,e,r,n){v(t,e,r,n,y)}function g(t,e,r,n){v(t,e,r,n,x)}function v(t,e,r,n,a){for(var i=n.tozero,o=n.extrapad,l=!0,s=0;s<t.length&&l;s++){var c=t[s];if(a(c.val,e)&&c.pad>=r&&(c.extrapad||!o)){l=!1;break}a(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(s,1),s--)}if(l){var u=i&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function m(t){return n(t)&&Math.abs(t)<i}function y(t,e){return t<=e}function x(t,e){return t>=e}},{"../../constants/numerical":212,"../../lib":233,"../../registry":326,"./axis_ids":282,"fast-isnumeric":23}],279:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../lib"),s=l.strTranslate,c=t("../../lib/svg_text_utils"),u=t("../../components/titles"),f=t("../../components/color"),d=t("../../components/drawing"),p=t("./layout_attributes"),h=t("./clean_ticks"),g=t("../../constants/numerical"),v=g.ONEMAXYEAR,m=g.ONEAVGYEAR,y=g.ONEMINYEAR,x=g.ONEMAXQUARTER,b=g.ONEAVGQUARTER,_=g.ONEMINQUARTER,w=g.ONEMAXMONTH,T=g.ONEAVGMONTH,k=g.ONEMINMONTH,M=g.ONEWEEK,A=g.ONEDAY,L=A/2,S=g.ONEHOUR,C=g.ONEMIN,O=g.ONESEC,D=g.MINUS_SIGN,z=g.BADNUM,P=t("../../constants/alignment"),E=P.MID_SHIFT,I=P.CAP_SHIFT,R=P.LINE_SPACING,F=P.OPPOSITE_SIDE,N=e.exports={};N.setConvert=t("./set_convert");var B=t("./axis_autotype"),H=t("./axis_ids"),j=H.idSort,U=H.isLinked;N.id2name=H.id2name,N.name2id=H.name2id,N.cleanId=H.cleanId,N.list=H.list,N.listIds=H.listIds,N.getFromId=H.getFromId,N.getFromTrace=H.getFromTrace;var V=t("./autorange");N.getAutoRange=V.getAutoRange,N.findExtremes=V.findExtremes;function q(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}N.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(t,e,u,c)},N.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},N.coercePosition=function(t,e,r,n,a,i){var o,s;if("range"!==N.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=N.getFromId(e,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}t[a]=o(s)},N.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?l.ensureNumber:N.getFromId(e,r).cleanPos)(t)},N.redrawComponents=function(t,e){e=e||N.listIds(t);var r=t._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u<e.length;u++)for(var f=r[N.id2name(e[u])][i],d=0;d<f.length;d++){var p=f[d];if(!c[p]&&(s(t,p),c[p]=1,l))return}}n("annotations","drawOne","_annIndices"),n("shapes","drawOne","_shapeIndices"),n("images","draw","_imgIndices",!0)};var G=N.getDataConversions=function(t,e,r,n){var a,i="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(i)){if(a={type:B(n,void 0,{autotypenumbers:t._fullLayout.autotypenumbers}),_categories:[]},N.setConvert(a),"category"===a.type)for(var o=0;o<n.length;o++)a.d2c(n[o])}else a=N.getFromTrace(t,e,i);return a?{d2c:a.d2c,c2d:a.c2d}:"ids"===i?{d2c:Y,c2d:Y}:{d2c:Z,c2d:Z}};function Z(t){return+t}function Y(t){return String(t)}function X(t){return+t.substring(1)}N.getDataToCoordFunc=function(t,e,r,n){return G(t,e,r,n).d2c},N.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},N.minDtick=function(t,e,r,n){-1===["log","category","multicategory"].indexOf(t.type)&&n?void 0===t._minDtick?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},N.saveRangeInitial=function(t,e){for(var r=N.list(t,"",!0),n=!1,a=0;a<r.length;a++){var i=r[a],o=void 0===i._rangeInitial,l=o||!(i.range[0]===i._rangeInitial[0]&&i.range[1]===i._rangeInitial[1]);(o&&!1===i.autorange||e&&l)&&(i._rangeInitial=i.range.slice(),n=!0)}return n},N.saveShowSpikeInitial=function(t,e){for(var r=N.list(t,"",!0),n=!1,a="on",i=0;i<r.length;i++){var o=r[i],l=void 0===o._showSpikeInitial,s=l||!(o.showspikes===o._showspikes);(l||e&&s)&&(o._showSpikeInitial=o.showspikes,n=!0),"on"!==a||o.showspikes||(a="off")}return t._fullLayout._cartesianSpikesEnabled=a,n},N.autoBin=function(t,e,r,n,i,o){var s,c=l.aggNums(Math.min,null,t),u=l.aggNums(Math.max,null,t);if("category"===e.type||"multicategory"===e.type)return{start:c-.5,end:u+.5,size:Math.max(1,Math.round(o)||1),_dataSpan:u-c};if(i||(i=e.calendar),s="log"===e.type?{type:"linear",range:[c,u]}:{type:e.type,range:l.simpleMap([c,u],e.c2r,0,i),calendar:i},N.setConvert(s),o=o&&h.dtick(o,s.type))s.dtick=o,s.tick0=h.tick0(void 0,s.type,i);else{var f;if(r)f=(u-c)/r;else{var d=l.distinctVals(t),p=Math.pow(10,Math.floor(Math.log(d.minDiff)/Math.LN10)),g=p*l.roundUp(d.minDiff/p,[.9,1.9,4.9,9.9],!0);f=Math.max(g,2*l.stdev(t)/Math.pow(t.length,n?.25:.4)),a(f)||(f=1)}N.autoTicks(s,f)}var v,m=s.dtick,y=N.tickIncrement(N.tickFirst(s),m,"reverse",i);if("number"==typeof m)v=(y=function(t,e,r,n,i){var o=0,l=0,s=0,c=0;function u(e){return(1+100*(e-t)/r.dtick)%100<2}for(var f=0;f<e.length;f++)e[f]%1==0?s++:a(e[f])||c++,u(e[f])&&o++,u(e[f]+r.dtick/2)&&l++;var d=e.length-c;if(s===d&&"date"!==r.type)r.dtick<1?t=n-.5*r.dtick:(t-=.5)+r.dtick<n&&(t+=r.dtick);else if(l<.1*d&&(o>.3*d||u(n)||u(i))){var p=r.dtick/2;t+=t+p<n?p:-p}return t}(y,t,s,c,u))+(1+Math.floor((u-y)/m))*m;else for("M"===s.dtick.charAt(0)&&(y=function(t,e,r,n,a){var i=l.findExactDates(e,a);if(i.exactDays>.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=N.tickIncrement(t,"M6","reverse")+1.5*A:i.exactMonths>.8?t=N.tickIncrement(t,"M1","reverse")+15.5*A:t-=L;var s=N.tickIncrement(t,r);if(s<=n)return s}return t}(y,t,m,c,i)),v=y,0;v<=u;)v=N.tickIncrement(v,m,!1,i);return{start:e.c2r(y,0,i),end:e.c2r(v,0,i),size:m,_dataSpan:u-c}},N.prepTicks=function(t,e){var r=l.simpleMap(t.range,t.r2l,void 0,void 0,e);if(t._dtickInit=t.dtick,t._tick0Init=t.tick0,"auto"===t.tickmode||!t.dtick){var n,i=t.nticks;i||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?1.2*(t.tickfont.size||12):15,i=t._length/n):(n="y"===t._id.charAt(0)?40:80,i=l.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(i*=2)),"array"===t.tickmode&&(i*=100),t._roughDTick=Math.abs(r[1]-r[0])/i,N.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(a(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),i=N.getTickFormat(t);if(i){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(e=S,o&&!n&&t.dtick<S&&(t.dtick=S)):/%p/.test(i)?(e=L,o&&!n&&t.dtick<L&&(t.dtick=L)):/%[Aadejuwx]/.test(i)?(e=A,o&&!n&&t.dtick<A&&(t.dtick=A)):/%[UVW]/.test(i)?(e=M,o&&!n&&t.dtick<M&&(t.dtick=M)):/%[Bbm]/.test(i)?(e=T,o&&(n?X(t.dtick)<1:t.dtick<k)&&(t.dtick="M1")):/%[q]/.test(i)?(e=b,o&&(n?X(t.dtick)<3:t.dtick<_)&&(t.dtick="M3")):/%[Yy]/.test(i)&&(e=m,o&&(n?X(t.dtick)<12:t.dtick<y)&&(t.dtick="M12")))}(n=r())&&t.tick0===t._dowTick0&&(t.tick0=t._rawTick0);t._definedDelta=e}(t),t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),nt(t)},N.calcTicks=function(t,e){N.prepTicks(t,e);var r=l.simpleMap(t.range,t.r2l,void 0,void 0,e);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),a=q(l.simpleMap(t.range,t.r2l)),i=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]),s=0;Array.isArray(r)||(r=[]);var c="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var u=0;u<e.length;u++){var f=c(e[u]);f>i&&f<o&&(void 0===r[u]?n[s]=N.tickText(t,f):n[s]=at(t,f,String(r[u])),s++)}s<e.length&&n.splice(s,e.length-s);t.rangebreaks&&(n=n.filter((function(e){return t.maskBreaks(e.x)!==z})));return n}(t);var n=q(r),i=n[0],o=n[1],s=r[1]<r[0],c=Math.min(r[0],r[1]),u=Math.max(r[0],r[1]),f="log"===t.type&&!(a(t.dtick)||"L"===t.dtick.charAt(0)),d="period"===t.ticklabelmode;if(t._tmin=N.tickFirst(t,e),t._tmin<i!==s)return[];"category"!==t.type&&"multicategory"!==t.type||(o=s?Math.max(-.5,o):Math.min(t._categories.length-.5,o));var p=t._tmin;t.rangebreaks&&t._tick0Init!==t.tick0&&(p=wt(p,t),s||(p=N.tickIncrement(p,t.dtick,!s,t.calendar))),d&&(p=N.tickIncrement(p,t.dtick,!s,t.calendar));for(var h,g=Math.max(1e3,t._length||0),C=[],O=null;s?p>=o:p<=o;p=N.tickIncrement(p,t.dtick,s,t.calendar)){if(t.rangebreaks&&!s){if(p<i)continue;if(t.maskBreaks(p)===z&&wt(p,t)>=u)break}if(C.length>g||p===O)break;O=p;var D=!1;f&&p!==(0|p)&&(D=!0),C.push({minor:D,value:p})}if(d&&function(t,e,r){for(var n=0;n<t.length;n++){var a=t[n].value,i=n,o=n+1;n<t.length-1?(i=n,o=n+1):n>0?(i=n-1,o=n):(i=n,o=n);var l,s=t[i].value,c=t[o].value,u=Math.abs(c-s),f=r||u,d=0;f>=y?d=u>=y&&u<=v?u:m:r===b&&f>=_?d=u>=_&&u<=x?u:b:f>=k?d=u>=k&&u<=w?u:T:r===M&&f>=M?d=M:f>=A?d=A:r===L&&f>=L?d=L:r===S&&f>=S&&(d=S),d>=u&&(d=u,l=!0);var p=a+d;if(e.rangebreaks&&d>0){for(var h=0,g=0;g<84;g++){var C=(g+.5)/84;e.maskBreaks(a*(1-C)+C*p)!==z&&h++}(d*=h/84)||(t[n].drop=!0),l&&u>M&&(d=u)}(d>0||0===n)&&(t[n].periodX=a+d/2)}}(C,t,t._definedDelta),t.rangebreaks){var P="y"===t._id.charAt(0),E=1;"auto"===t.tickmode&&(E=t.tickfont?t.tickfont.size:12);var I=NaN;for(h=C.length-1;h>-1;h--)if(C[h].drop)C.splice(h,1);else{C[h].value=wt(C[h].value,t);var R=t.c2p(C[h].value);(P?I>R-E:I<R+E)?C.splice(s?h+1:h,1):I=R}}_t(t)&&360===Math.abs(r[1]-r[0])&&C.pop(),t._tmax=(C[C.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;var F,B,H=[];for(h=0;h<C.length;h++){var j=C[h].minor,U=C[h].value;F=N.tickText(t,U,!1,j),void 0!==(B=C[h].periodX)&&(F.periodX=B,(B>u||B<c)&&(B>u&&(F.periodX=u),B<c&&(F.periodX=c),F.text=" ",t._prevDateHead="")),H.push(F)}return t._inCalcTicks=!1,H};var W=[2,5,10],Q=[1,2,3,6,12],J=[1,2,5,10,15,30],$=[1,2,3,7,14],K=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],tt=[-.301,0,.301,.699,1],et=[15,30,45,90,180];function rt(t,e,r){return e*l.roundUp(t/e,r)}function nt(t){var e=t.dtick;if(t._tickexponent=0,a(e)||"string"==typeof e||(e=1),"category"!==t.type&&"multicategory"!==t.type||(t._tickround=null),"date"===t.type){var r=t.r2l(t.tick0),n=t.l2r(r).replace(/(^-|i)/g,""),i=n.length;if("M"===String(e).charAt(0))i>10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=A&&i<=10||e>=15*A)t._tickround="d";else if(e>=C&&i<=16||e>=S)t._tickround="M";else if(e>=O&&i<=19||e>=C)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var l=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(ot(t.exponentformat)&&!lt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function at(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}N.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=l.dateTick0(t.calendar,0);var i=2*e;if(i>m)e/=m,r=n(10),t.dtick="M"+12*rt(e,r,W);else if(i>T)e/=T,t.dtick="M"+rt(e,1,Q);else if(i>A){t.dtick=rt(e,A,t._hasDayOfWeekBreaks?[1,2,7,14]:$);var o=N.getTickFormat(t),s="period"===t.ticklabelmode;s&&(t._rawTick0=t.tick0),/%[uVW]/.test(o)?t.tick0=l.dateTick0(t.calendar,2):t.tick0=l.dateTick0(t.calendar,1),s&&(t._dowTick0=t.tick0)}else i>S?t.dtick=rt(e,S,Q):i>C?t.dtick=rt(e,C,J):i>O?t.dtick=rt(e,O,J):(r=n(10),t.dtick=rt(e,r,W))}else if("log"===t.type){t.tick0=0;var c=l.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(c[1]-c[0])<1){var u=1.5*Math.abs((c[1]-c[0])/e);e=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/u,r=n(10),t.dtick="L"+rt(e,r,W)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):_t(t)?(t.tick0=0,r=1,t.dtick=rt(e,r,et)):(t.tick0=0,r=n(10),t.dtick=rt(e,r,W));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var f=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(f)}},N.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return l.increment(t,o*e);var s=e.charAt(0),c=o*Number(e.substr(1));if("M"===s)return l.incrementMonth(t,c,i);if("L"===s)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===s){var u="D2"===e?tt:K,f=t+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(e)},N.tickFirst=function(t,e){var r=t.r2l||Number,i=l.simpleMap(t.range,r,void 0,void 0,e),o=i[1]<i[0],s=o?Math.floor:Math.ceil,c=q(i)[0],u=t.dtick,f=r(t.tick0);if(a(u)){var d=s((c-f)/u)*u+f;return"category"!==t.type&&"multicategory"!==t.type||(d=l.constrain(d,0,t._categories.length-1)),d}var p=u.charAt(0),h=Number(u.substr(1));if("M"===p){for(var g,v,m,y=0,x=f;y<10;){if(((g=N.tickIncrement(x,u,o,t.calendar))-c)*(x-c)<=0)return o?Math.min(x,g):Math.max(x,g);v=(c-(x+g)/2)/(g-x),m=p+(Math.abs(Math.round(v))||1)*h,x=N.tickIncrement(x,m,v<0?!o:o,t.calendar),y++}return l.error("tickFirst did not converge",t),x}if("L"===p)return Math.log(s((Math.pow(10,c)-f)/h)*h+f)/Math.LN10;if("D"===p){var b="D2"===u?tt:K,_=l.roundUp(l.mod(c,1),b,o);return Math.floor(c)+Math.log(n.round(Math.pow(10,_),1))/Math.LN10}throw"unrecognized dtick "+String(u)},N.tickText=function(t,e,r,n){var i,o=at(t,e),s="array"===t.tickmode,c=r||s,u=t.type,f="category"===u?t.d2l_noadd:t.d2l;if(s&&Array.isArray(t.ticktext)){var d=l.simpleMap(t.range,t.r2l),p=(Math.abs(d[1]-d[0])-(t._lBreaks||0))/1e4;for(i=0;i<t.ticktext.length&&!(Math.abs(e-f(t.tickvals[i]))<p);i++);if(i<t.ticktext.length)return o.text=String(t.ticktext[i]),o}function h(n){if(void 0===n)return!0;if(r)return"none"===n;var a={first:t._tmin,last:t._tmax}[n];return"all"!==n&&e!==a}var g=r?"never":"none"!==t.exponentformat&&h(t.showexponent)?"hide":"";if("date"===u?function(t,e,r,n){var i=t._tickround,o=r&&t.hoverformat||N.getTickFormat(t);n&&(i=a(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var s,c=l.formatDate(e.x,o,i,t._dateFormat,t.calendar,t._extraFormat),u=c.indexOf("\n");-1!==u&&(s=c.substr(u+1),c=c.substr(0,u));n&&("00:00:00"===c||"00:00"===c?(c=s,s=""):8===c.length&&(c=c.replace(/:00$/,"")));if(s)if(r)"d"===i?c+=", "+s:c=s+(c?", "+c:"");else if(t._inCalcTicks&&t._prevDateHead===s){var f=-1!==(t.ticklabelposition||"").indexOf("inside"),d=t._realSide||t.side;(!f&&"top"===d||f&&"bottom"===d)&&(c+="<br> ")}else t._prevDateHead=s,c+="<br>"+s;e.text=c}(t,o,r,c):"log"===u?function(t,e,r,n,i){var o=t.dtick,s=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=st(Math.pow(10,s),t,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=t.exponentformat;"power"===p||ot(p)&&lt(f)?(e.text=0===f?1:1===f?"10":"10<sup>"+(f>1?"":D)+d+"</sup>",e.fontSize*=1.25):("e"===p||"E"===p)&&d>2?e.text="1"+p+(f>0?"+":D)+d:(e.text=st(Math.pow(10,s),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,l.mod(s,1)))),e.fontSize*=.75}if("D1"===t.dtick){var h=String(e.text).charAt(0);"0"!==h&&"1"!==h||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(s<0?.5:.25)))}}(t,o,0,c,g):"category"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===u?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,o,r):_t(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=st(e.x,t,a,n);else{var i=e.x/180;if(0===i)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,a=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)e.text=st(l.deg2rad(e.x),t,a,n);else{var s=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["<sup>",o[0],"</sup>","\u2044","<sub>",o[1],"</sub>","\u03c0"].join(""),s&&(e.text=D+e.text)}}}}(t,o,r,c,g):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=st(e.x,t,a,n)}(t,o,0,c,g),n||(t.tickprefix&&!h(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!h(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var v=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[v(o.x-.5),v(o.x+t.dtick-.5)]}return o},N.hoverLabelText=function(t,e,r){if(r!==z&&r!==e)return N.hoverLabelText(t,e)+" - "+N.hoverLabelText(t,r);var n="log"===t.type&&e<=0,a=N.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":D+a:a};var it=["f","p","n","\u03bc","m","","k","M","G","T"];function ot(t){return"SI"===t||"B"===t}function lt(t){return t>14||t<-15}function st(t,e,r,n){var i=t<0,o=e._tickround,s=r||e.exponentformat||"B",c=e._tickexponent,u=N.getTickFormat(e),f=e.separatethousands;if(n){var d={exponentformat:s,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};nt(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,D);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(t=Math.abs(t))<h)t="0",i=!1;else{if(t+=h,c&&(t*=Math.pow(10,-c),o+=c),0===o)t=String(Math.floor(t));else if(o<0){t=(t=String(Math.round(t))).substr(0,t.length+o);for(var g=o;g<0;g++)t+="0"}else{var v=(t=String(t)).indexOf(".")+1;v&&(t=t.substr(0,v+o).replace(/\.?0+$/,""))}t=l.numSeparate(t,e._separators,f)}c&&"hide"!==s&&(ot(s)&&lt(c)&&(s="power"),p=c<0?D+-c:"power"!==s?"+"+c:String(c),"e"===s||"E"===s?t+=s+p:"power"===s?t+="\xd710<sup>"+p+"</sup>":"B"===s&&9===c?t+="B":ot(s)&&(t+=it[c/3+5]));return i?D+t:t}function ct(t,e){for(var r=[],n={},a=0;a<e.length;a++){var i=e[a];n[i.text2]?n[i.text2].push(i.x):n[i.text2]=[i.x]}for(var o in n)r.push(at(t,l.interp(n[o],.5),o));return r}function ut(t){return void 0!==t.periodX?t.periodX:t.x}function ft(t){return[t.text,t.x,t.axInfo,t.font,t.fontSize,t.fontColor].join("_")}function dt(t){var e=t.title.font.size,r=(t.title.text.match(c.BR_TAG_ALL)||[]).length;return t.title.hasOwnProperty("standoff")?r?e*(I+r*R):e*I:r?e*(r+1)*R:e}function pt(t,e){var r=t.l2p(e);return r>1&&r<t._length-1}function ht(t){var e=n.select(t),r=e.select(".text-math-group");return r.empty()?e.select("text"):r}function gt(t){return t._id+".automargin"}function vt(t){return gt(t)+".mirror"}function mt(t){return t._id+".rangeslider"}function yt(t,e){for(var r=0;r<e.length;r++)-1===t.indexOf(e[r])&&t.push(e[r])}function xt(t,e,r){var n,a,i=[],o=[],s=t.layout;for(n=0;n<e.length;n++)i.push(N.getFromId(t,e[n]));for(n=0;n<r.length;n++)o.push(N.getFromId(t,r[n]));var c=Object.keys(p),u=["anchor","domain","overlaying","position","side","tickangle","editType"],f=["linear","log"];for(n=0;n<c.length;n++){var d=c[n],h=i[0][d],g=o[0][d],v=!0,m=!1,y=!1;if("_"!==d.charAt(0)&&"function"!=typeof h&&-1===u.indexOf(d)){for(a=1;a<i.length&&v;a++){var x=i[a][d];"type"===d&&-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][d];"type"===d&&-1!==f.indexOf(g)&&-1!==f.indexOf(b)&&g!==b?y=!0:o[a][d]!==g&&(v=!1)}v&&(m&&(s[i[0]._name].type="linear"),y&&(s[o[0]._name].type="linear"),bt(s,d,i,o,t._fullLayout._dfltTitle))}}for(n=0;n<t._fullLayout.annotations.length;n++){var _=t._fullLayout.annotations[n];-1!==e.indexOf(_.xref)&&-1!==r.indexOf(_.yref)&&l.swapAttrs(s.annotations[n],["?"])}}function bt(t,e,r,n,a){var i,o=l.nestedProperty,s=o(t[r[0]._name],e).get(),c=o(t[n[0]._name],e).get();for("title"===e&&(s&&s.text===a.x&&(s.text=a.y),c&&c.text===a.y&&(c.text=a.x)),i=0;i<r.length;i++)o(t,r[i]._name+"."+e).set(c);for(i=0;i<n.length;i++)o(t,n[i]._name+"."+e).set(s)}function _t(t){return"angularaxis"===t._id}function wt(t,e){for(var r=e._rangebreaks.length,n=0;n<r;n++){var a=e._rangebreaks[n];if(t>=a.min&&t<a.max)return a.max}return t}N.getTickFormat=function(t){var e,r,n,a,i,o,l,s;function c(t){return"string"!=typeof t?t:Number(t.replace("M",""))*T}function u(t,e){var r=["L","D"];if(typeof t==typeof e){if("number"==typeof t)return t-e;var n=r.indexOf(t.charAt(0)),a=r.indexOf(e.charAt(0));return n===a?Number(t.replace(/(L|D)/g,""))-Number(e.replace(/(L|D)/g,"")):n-a}return"number"==typeof t?1:-1}function f(t,e){var r=null===e[0],n=null===e[1],a=u(t,e[0])>=0,i=u(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&(a=t.dtick,i=n.dtickrange,o=void 0,l=void 0,s=void 0,o=c||function(t){return t},l=i[0],s=i[1],(!l&&"number"!=typeof l||o(l)<=o(a))&&(!s&&"number"!=typeof s||o(s)>=o(a)))){r=n;break}break;case"log":for(e=0;e<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&f(t.dtick,n.dtickrange)){r=n;break}}return r?r.value:t.tickformat},N.getSubplots=function(t,e){var r=t._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),a=e?N.findSubplotsWithAxis(n,e):n;return a.sort((function(t,e){var r=t.substr(1).split("y"),n=e.substr(1).split("y");return r[0]===n[0]?+r[1]-+n[1]:+r[0]-+n[0]})),a},N.findSubplotsWithAxis=function(t,e){for(var r=new RegExp("x"===e._id.charAt(0)?"^"+e._id+"y":e._id+"$"),n=[],a=0;a<t.length;a++){var i=t[a];r.test(i)&&n.push(i)}return n},N.makeClipPaths=function(t){var e=t._fullLayout;if(!e._hasOnlyLargeSploms){var r,a,i={_offset:0,_length:e.width,_id:""},o={_offset:0,_length:e.height,_id:""},l=N.list(t,"x",!0),s=N.list(t,"y",!0),c=[];for(r=0;r<l.length;r++)for(c.push({x:l[r],y:o}),a=0;a<s.length;a++)0===r&&c.push({x:i,y:s[a]}),c.push({x:l[r],y:s[a]});var u=e._clips.selectAll(".axesclip").data(c,(function(t){return t.x._id+t.y._id}));u.enter().append("clipPath").classed("axesclip",!0).attr("id",(function(t){return"clip"+e._uid+t.x._id+t.y._id})).append("rect"),u.exit().remove(),u.each((function(t){n.select(this).select("rect").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})}))}},N.draw=function(t,e,r){var n=t._fullLayout;"redraw"===e&&n._paper.selectAll("g.subplot").each((function(t){var e=t[0],r=n._plots[e];if(r){var a=r.xaxis,i=r.yaxis;r.xaxislayer.selectAll("."+a._id+"tick").remove(),r.yaxislayer.selectAll("."+i._id+"tick").remove(),r.xaxislayer.selectAll("."+a._id+"tick2").remove(),r.yaxislayer.selectAll("."+i._id+"tick2").remove(),r.xaxislayer.selectAll("."+a._id+"divider").remove(),r.yaxislayer.selectAll("."+i._id+"divider").remove(),r.gridlayer&&r.gridlayer.selectAll("path").remove(),r.zerolinelayer&&r.zerolinelayer.selectAll("path").remove(),n._infolayer.select(".g-"+a._id+"title").remove(),n._infolayer.select(".g-"+i._id+"title").remove()}}));var a=e&&"redraw"!==e?e:N.listIds(t);return l.syncOrAsync(a.map((function(e){return function(){if(e){var n=N.getFromId(t,e),a=N.drawOne(t,n,r);return n._r=n.range.slice(),n._rl=l.simpleMap(n._r,n.r2l),a}}})))},N.drawOne=function(t,e,r){var n,a,s;r=r||{},e.setScale();var c=t._fullLayout,p=e._id,h=p.charAt(0),g=N.counterLetter(p),v=c._plots[e._mainSubplot];if(v){var m=v[h+"axislayer"],y=e._mainLinePosition,x=e._mainMirrorPosition,b=e._vals=N.calcTicks(e),_=[e.mirror,y,x].join("_");for(n=0;n<b.length;n++)b[n].axInfo=_;e._selections={},e._tickAngles&&(e._prevTickAngles=e._tickAngles),e._tickAngles={},e._depth=null;var w={};if(e.visible){var T,k,M=N.makeTransTickFn(e),A=N.makeTransTickLabelFn(e),L="inside"===e.ticks,S="outside"===e.ticks;if("boundaries"===e.tickson){var C=function(t,e){var r,n=[],a=function(t,e){var r=t.xbnd[e];null!==r&&n.push(l.extendFlat({},t,{x:r}))};if(e.length){for(r=0;r<e.length;r++)a(e[r],0);a(e[r-1],1)}return n}(0,b);k=N.clipEnds(e,C),T=L?k:C}else k=N.clipEnds(e,b),T=L&&"period"!==e.ticklabelmode?k:b;var O=e._gridVals=k,D=function(t,e){var r,n,a=[],i=e.length&&e[e.length-1].x<e[0].x,o=function(t,e){var r=t.xbnd[e];null!==r&&a.push(l.extendFlat({},t,{x:r}))};if(t.showdividers&&e.length){for(r=0;r<e.length;r++){var s=e[r];s.text2!==n&&o(s,i?1:0),n=s.text2}o(e[r-1],i?0:1)}return a}(e,b);if(!c._hasOnlyLargeSploms){var z=e._subplotsWith,P={};for(n=0;n<z.length;n++){a=z[n];var E=(s=c._plots[a])[g+"axis"],I=E._mainAxis._id;if(!P[I]){P[I]=1;var B="x"===h?"M0,"+E._offset+"v"+E._length:"M"+E._offset+",0h"+E._length;N.drawGrid(t,e,{vals:O,counterAxis:E,layer:s.gridlayer.select("."+p),path:B,transFn:M}),N.drawZeroLine(t,e,{counterAxis:E,layer:s.zerolinelayer,path:B,transFn:M})}}}var H=N.getTickSigns(e),j=[];if(e.ticks){var U,V,q,G=N.makeTickPath(e,y,H[2]);if(e._anchorAxis&&e.mirror&&!0!==e.mirror?(U=N.makeTickPath(e,x,H[3]),V=G+U):(U="",V=G),e.showdividers&&S&&"boundaries"===e.tickson){var Z={};for(n=0;n<D.length;n++)Z[D[n].x]=1;q=function(t){return Z[t.x]?U:V}}else q=V;N.drawTicks(t,e,{vals:T,layer:m,path:q,transFn:M}),"allticks"===e.mirror&&(j=Object.keys(e._linepositions||{}))}for(n=0;n<j.length;n++){a=j[n],s=c._plots[a];var Y=e._linepositions[a]||[],X=N.makeTickPath(e,Y[0],H[0])+N.makeTickPath(e,Y[1],H[1]);N.drawTicks(t,e,{vals:T,layer:s[h+"axislayer"],path:X,transFn:M})}var W=[];if(W.push((function(){return N.drawLabels(t,e,{vals:b,layer:m,transFn:A,labelFns:N.makeLabelFns(e,y)})})),"multicategory"===e.type){var Q={x:2,y:10}[h];W.push((function(){var r={x:"height",y:"width"}[h],n=$()[r]+Q+(e._tickAngles[p+"tick"]?e.tickfont.size*R:0);return N.drawLabels(t,e,{vals:ct(e,b),layer:m,cls:p+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:M,labelFns:N.makeLabelFns(e,y+n*H[4])})})),W.push((function(){return e._depth=H[4]*($("tick2")[e.side]-y),function(t,e,r){var n=e._id+"divider",a=r.vals,i=r.layer.selectAll("path."+n).data(a,ft);i.exit().remove(),i.enter().insert("path",":first-child").classed(n,1).classed("crisp",1).call(f.stroke,e.dividercolor).style("stroke-width",d.crispRound(t,e.dividerwidth,1)+"px"),i.attr("transform",r.transFn).attr("d",r.path)}(t,e,{vals:D,layer:m,path:N.makeTickPath(e,y,H[4],e._depth),transFn:M})}))}else e.title.hasOwnProperty("standoff")&&W.push((function(){e._depth=H[4]*($()[e.side]-y)}));var J=o.getComponentMethod("rangeslider","isVisible")(e);return W.push((function(){var r,n,a,l,s=e.side.charAt(0),u=F[e.side].charAt(0),f=N.getPxPosition(t,e),d=S?e.ticklen:0;if((e.automargin||J)&&("multicategory"===e.type?r=$("tick2"):(r=$(),"x"===h&&"b"===s&&(e._depth=Math.max(r.width>0?r.bottom-f:0,d)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=e._depth:(n[s]=e._depth=Math.max(r.width>0?f-r.top:0,d),p.reverse()),r.width>0){var v=r.right-(e._offset+e._length);v>0&&(n.xr=1,n.r=v);var m=e._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===s?n[s]=e._depth=Math.max(r.height>0?f-r.left:0,d):(n[s]=e._depth=Math.max(r.height>0?r.right-f:0,d),p.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var x=e._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[g]="free"===e.anchor?e.position:e._anchorAxis.domain[p[0]],e.title.text!==c._dfltTitle[h]&&(n[s]+=dt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(a[u]+=d),!0===e.mirror||"ticks"===e.mirror?a[g]=e._anchorAxis.domain[p[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(a[g]=[e._counterDomainMin,e._counterDomainMax][p[1]]))}J&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,gt(e),n),i.autoMargin(t,vt(e),a),i.autoMargin(t,mt(e),l)})),r.skipTitle||J&&"bottom"===e.side||W.push((function(){return function(t,e){var r,n=t._fullLayout,a=e._id,i=a.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+dt(e);else{var l=-1!==(e.ticklabelposition||"").indexOf("inside");if("multicategory"===e.type)r=e._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===e.ticks&&(s+=e.ticklen)),r=10+s+(e.linewidth?e.linewidth-1:0)}l||(r+="x"===i?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0))}var c,f,p,h,g=N.getPxPosition(t,e);"x"===i?(f=e._offset+e._length/2,p="top"===e.side?g-r:g+r):(p=e._offset+e._length/2,f="right"===e.side?g+r:g-r,c={rotate:"-90",offset:0});if("multicategory"!==e.type){var v=e._selections[e._id+"tick"];if(h={selection:v,side:e.side},v&&v.node()&&v.node().parentNode){var m=d.getTranslate(v.node().parentNode);h.offsetLeft=m.x,h.offsetTop=m.y}e.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:f,y:p,"text-anchor":"middle"}})}(t,e)})),l.syncOrAsync(W)}}function $(t){var r=p+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,a,i;t._selections[e].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,t._selections[e].each((function(){var t=ht(this),e=d.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),a=Math.min(a,e.left),i=Math.max(i,e.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(e,r)),w[r]}},N.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},N.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return s(t._offset+t.l2p(e.x),0)}:function(e){return s(0,t._offset+t.l2p(e.x))}},N.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),l=r("inside"),s=o||a||n||i;if(!s&&!l)return[0,0];var c=t.side,u=s?(t.tickwidth||0)/2:0,f=3,d=t.tickfont?t.tickfont.size:12;(o||n)&&(u+=d*I,f+=(t.linewidth||0)/2);(a||i)&&(u+=(t.linewidth||0)/2,f+=3);l&&"top"===c&&(f-=d*(1-I));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[s?u:0,l?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return s(r+t._offset+t.l2p(ut(e)),n)}:function(e){return s(n,r+t._offset+t.l2p(ut(e)))}},N.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var a=t._id.charAt(0),i=(t.linewidth||1)/2;return"x"===a?"M0,"+(e+i*r)+"v"+n*r:"M"+(e+i*r)+",0h"+n*r},N.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",i=function(t){return-1!==n.indexOf(t)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,f=i("inside"),d="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,p=0,h=0,g=d?t.ticklen:0;if(f?g*=-1:u&&(g=0),d&&(p+=g,r)){var v=l.deg2rad(r);p=g*Math.cos(v)+1,h=g*Math.sin(v)}t.showticklabels&&(d||t.showline)&&(p+=.2*t.tickfont.size);var m,y,x,b,_,w={labelStandoff:p+=(t.linewidth||1)/2*(f?-1:1),labelShift:h},T=0,k=t.side,M=t._id.charAt(0),A=t.tickangle;if("x"===M)b=(_=!f&&"bottom"===k||f&&"top"===k)?1:-1,f&&(b*=-1),m=h*b,y=e+p*b,x=_?1:-.2,90===Math.abs(A)&&(f?x+=E:x=-90===A&&"bottom"===k?I:90===A&&"top"===k?E:.5,T=E/2*(A/90)),w.xFn=function(t){return t.dx+m+T*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*x},w.anchorFn=function(t,e){if(u){if(s)return"end";if(c)return"start"}return a(e)&&0!==e&&180!==e?e*b<0!==f?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==f?-n:0};else if("y"===M){if(b=(_=!f&&"left"===k||f&&"right"===k)?1:-1,f&&(b*=-1),m=p,y=h*b,x=0,f||90!==Math.abs(A)||(x=-90===A&&"left"===k||90===A&&"right"===k?I:.5),f){var L=a(A)?+A:0;if(0!==L){var S=l.deg2rad(L);T=Math.abs(Math.sin(S))*I*b,x=0}}w.xFn=function(t){return t.dx+e-(m+t.fontSize*x)*b+T*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*E},w.anchorFn=function(t,e){return a(e)&&90===Math.abs(e)?"middle":_?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},N.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.vals;"period"===e.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(e.ticks?a:[],ft);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(f.stroke,e.tickcolor).style("stroke-width",d.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),i.attr("transform",r.transFn)},N.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",a=r.vals,i=r.counterAxis;if(!1===e.showgrid)a=[];else if(i&&N.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,l=0;l<a.length;l++){var s=a[l].x;if(o?!s:Math.abs(s)<e.dtick/100){if(a=a.slice(0,l).concat(a.slice(l+1)),!o)break;l--}}var c=r.layer.selectAll("path."+n).data(a,ft);c.exit().remove(),c.enter().append("path").classed(n,1).classed("crisp",!1!==r.crisp),e._gw=d.crispRound(t,e.gridwidth,1),c.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,e.gridcolor||"#ddd").style("stroke-width",e._gw+"px"),"function"==typeof r.path&&c.attr("d",r.path)},N.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",a=N.shouldShowZeroLine(t,e,r.counterAxis),i=r.layer.selectAll("path."+n).data(a?[{x:0,id:e._id}]:[]);i.exit().remove(),i.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(t,e){return j(t.id,e.id)}))})),i.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,e.zerolinecolor||f.defaultLine).style("stroke-width",d.crispRound(t,e.zerolinewidth,e._gw||1)+"px")},N.drawLabels=function(t,e,r){r=r||{};var i=t._fullLayout,o=e._id,u=o.charAt(0),f=r.cls||o+"tick",p=r.vals,h=r.labelFns,g=r.secondary?0:e.tickangle,v=(e._prevTickAngles||{})[f],m=r.layer.selectAll("g."+f).data(e.showticklabels?p:[],ft),y=[];function x(t,i){var o=-1!==(e.ticklabelposition||"").indexOf("inside");t.each((function(t){var l=n.select(this),u=l.select(".text-math-group"),f=h.anchorFn(t,i),p=r.transFn.call(l.node(),t)+(a(i)&&0!=+i?" rotate("+i+","+h.xFn(t)+","+(h.yFn(t)-t.fontSize/2)+")":""),g=c.lineCount(l),v=R*t.fontSize,m=h.heightFn(t,a(i)?+i:0,(g-1)*v);if(m&&(p+=s(0,m)),u.empty()){var y=l.select("text");y.attr({transform:p,"text-anchor":f}),o&&(y.style({opacity:100}),e._hideOutOfRangeInsideTickLabels&&e._hideOutOfRangeInsideTickLabels())}else{var x=d.bBox(u.node()).width*{end:-.5,start:.5}[f];u.attr("transform",p+s(x,0))}}))}m.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(e){var r=n.select(this),a=t._promises.length;r.call(c.positionText,h.xFn(e),h.yFn(e)).call(d.font,e.font,e.fontSize,e.fontColor).text(e.text).call(c.convertToTspans,t),t._promises[a]?y.push(t._promises.pop().then((function(){x(r,g)}))):x(r,g)})),m.exit().remove(),r.repositionOnUpdate&&m.each((function(t){n.select(this).select("text").call(c.positionText,h.xFn(t),h.yFn(t))})),e._hideOutOfRangeInsideTickLabels=void 0,-1!==(e.ticklabelposition||"").indexOf("inside")&&(e._hideOutOfRangeInsideTickLabels=function(){var t=l.simpleMap(e.range,e.r2l),r=e.l2p(t[0]),a=e.l2p(t[1]),i=Math.min(r,a)+e._offset,o=Math.max(r,a)+e._offset,s="x"===e._id.charAt(0);m.each((function(t){var r=n.select(this);if(r.select(".text-math-group").empty()){var a=d.bBox(r.node()),l=!1;s?(a.right>o||a.left<i)&&(l=!0):(a.bottom>o||a.top+(e.tickangle?0:t.fontSize/4)<i)&&(l=!0),l&&r.select("text").style({opacity:0})}}))}),x(m,v+1?v:g);var b=null;e._selections&&(e._selections[f]=m);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&i._redrawFromAutoMarginCount&&90===v?(b=90,_.push((function(){x(m,v)}))):_.push((function(){if(x(m,g),p.length&&"x"===u&&!a(g)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){b=0;var t,n=0,i=[];if(m.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),a=ht(this),o=d.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*e._m)/(o-1),c=e.ticklabelposition||"",f=function(t){return-1!==c.indexOf(t)},h=f("top"),v=f("left"),y=f("right"),_=f("bottom")||v||h||y?(e.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===e.type;for(t=0;t<i.length-1;t++)if(l.bBoxIntersect(i[t],i[t+1],_)){b=w?90:30;break}}else{var T=2;for(e.ticks&&(T+=e.tickwidth/2),t=0;t<i.length;t++){var k=p[t].xbnd,M=i[t];if(null!==k[0]&&M.left-e.l2p(k[0])<T||null!==k[1]&&e.l2p(k[1])-M.right<T){b=90;break}}}b&&x(m,b)}})),e._tickAngles&&_.push((function(){e._tickAngles[f]=null===b?a(g)?g:0:b}));var w=e._anchorAxis;w&&w.autorange&&-1!==(e.ticklabelposition||"").indexOf("inside")&&!U(i,e._id)&&(i._insideTickLabelsAutorange||(i._insideTickLabelsAutorange={}),i._insideTickLabelsAutorange[w._name+".autorange"]=w.autorange,_.push((function(){m.each((function(t,r){var n=ht(this);e._vals[r].bb=d.bBox(n.node())}))})));var T=l.syncOrAsync(_);return T&&T.then&&t._promises.push(T),T},N.getPxPosition=function(t,e){var r,n=t._fullLayout._size,a=e._id.charAt(0),i=e.side;return"free"!==e.anchor?r=e._anchorAxis:"x"===a?r={_offset:n.t+(1-(e.position||0))*n.h,_length:0}:"y"===a&&(r={_offset:n.l+(e.position||0)*n.w,_length:0}),"top"===i||"left"===i?r._offset:"bottom"===i||"right"===i?r._offset+r._length:void 0},N.shouldShowZeroLine=function(t,e,r){var n=l.simpleMap(e.range,e.r2l);return n[0]*n[1]<=0&&e.zeroline&&("linear"===e.type||"-"===e.type)&&!(e.rangebreaks&&e.maskBreaks(0)===z)&&(pt(e,0)||!function(t,e,r,n){var a=r._mainAxis;if(!a)return;var i=t._fullLayout,o=e._id.charAt(0),l=N.counterLetter(e._id),s=e._offset+(Math.abs(n[0])<Math.abs(n[1])==("x"===o)?0:e._length);function c(t){if(!t.showline||!t.linewidth)return!1;var r=Math.max((t.linewidth+e.zerolinewidth)/2,1);function n(t){return"number"==typeof t&&Math.abs(t-s)<r}if(n(t._mainLinePosition)||n(t._mainMirrorPosition))return!0;var a=t._linepositions||{};for(var i in a)if(n(a[i][0])||n(a[i][1]))return!0}var u=i._plots[r._mainSubplot];if(!(u.mainplotinfo||u).overlays.length)return c(r);for(var f=N.list(t,l),d=0;d<f.length;d++){var p=f[d];if(p._mainAxis===a&&c(p))return!0}}(t,e,r,n)||function(t,e){for(var r=t._fullData,n=e._mainSubplot,a=e._id.charAt(0),i=0;i<r.length;i++){var l=r[i];if(!0===l.visible&&l.xaxis+l.yaxis===n){if(o.traceIs(l,"bar-like")&&l.orientation==={x:"h",y:"v"}[a])return!0;if(l.fill&&l.fill.charAt(l.fill.length-1)===a)return!0}}return!1}(t,e))},N.clipEnds=function(t,e){return e.filter((function(e){return pt(t,e.x)}))},N.allowAutoMargin=function(t){for(var e=N.list(t,"",!0),r=0;r<e.length;r++){var n=e[r];n.automargin&&(i.allowAutoMargin(t,gt(n)),n.mirror&&i.allowAutoMargin(t,vt(n))),o.getComponentMethod("rangeslider","isVisible")(n)&&i.allowAutoMargin(t,mt(n))}},N.swap=function(t,e){for(var r=function(t,e){var r,n,a=[];for(r=0;r<e.length;r++){var i=[],o=t._fullData[e[r]].xaxis,l=t._fullData[e[r]].yaxis;if(o&&l){for(n=0;n<a.length;n++)-1===a[n].x.indexOf(o)&&-1===a[n].y.indexOf(l)||i.push(n);if(i.length){var s,c=a[i[0]];if(i.length>1)for(n=1;n<i.length;n++)s=a[i[n]],yt(c.x,s.x),yt(c.y,s.y);yt(c.x,[o]),yt(c.y,[l])}else a.push({x:[o],y:[l]})}}return a}(t,e),n=0;n<r.length;n++)xt(t,r[n].x,r[n].y)}},{"../../components/color":105,"../../components/drawing":127,"../../components/titles":200,"../../constants/alignment":207,"../../constants/numerical":212,"../../lib":233,"../../lib/svg_text_utils":255,"../../plots/plots":313,"../../registry":326,"./autorange":278,"./axis_autotype":280,"./axis_ids":282,"./clean_ticks":284,"./layout_attributes":293,"./set_convert":299,d3:21,"fast-isnumeric":23}],280:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM,o=a.isArrayOrTypedArray,l=a.isDateTime,s=a.cleanNumber,c=Math.round;function u(t,e){return e?n(t):"number"==typeof t}function f(t){return Math.max(1,(t-1)/1e3)}e.exports=function(t,e,r){var a=t,d=r.noMultiCategory;if(o(a)&&!a.length)return"-";if(!d&&function(t){return o(t[0])&&o(t[1])}(a))return"multicategory";if(d&&Array.isArray(a[0])){for(var p=[],h=0;h<a.length;h++)if(o(a[h]))for(var g=0;g<a[h].length;g++)p.push(a[h][g]);a=p}if(function(t,e){for(var r=t.length,a=f(r),i=0,o=0,s={},u=0;u<r;u+=a){var d=c(u),p=t[d],h=String(p);s[h]||(s[h]=1,l(p,e)&&i++,n(p)&&o++)}return i>2*o}(a,e))return"date";var v="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),a=0,o=0,l={},u=0;u<r;u+=n){var d=c(u),p=t[d],h=String(p);if(!l[h]){l[h]=1;var g=typeof p;"boolean"===g?o++:(e?s(p)!==i:"number"===g)?a++:"string"===g&&o++}}return o>2*a}(a,v)?"category":function(t,e){for(var r=t.length,n=0;n<r;n++)if(u(t[n],e))return!0;return!1}(a,v)?"linear":"-"}},{"../../constants/numerical":212,"../../lib":233,"fast-isnumeric":23}],281:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../lib"),o=t("../array_container_defaults"),l=t("./layout_attributes"),s=t("./tick_value_defaults"),c=t("./tick_mark_defaults"),u=t("./tick_label_defaults"),f=t("./category_order_defaults"),d=t("./line_grid_defaults"),p=t("./set_convert"),h=t("./constants").WEEKDAY_PATTERN,g=t("./constants").HOUR_PATTERN;function v(t,e,r){function a(r,n){return i.coerce(t,e,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]))&&(e.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(e.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(e.enabled=!1);e.bounds[s]=o[s]=c;break;case g:if(!n(c))return void(e.enabled=!1);if((c=+c)<0||c>24)return void(e.enabled=!1);e.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(e.enabled=!1)}else if(o[0]>d[0]&&o[1]<d[1])return void(e.enabled=!1)}}else{var p=a("values");if(!p||!p.length)return void(e.enabled=!1);a("dvalue")}}}e.exports=function(t,e,r,n,g){var m,y=n.letter,x=n.font||{},b=n.splomStash||{},_=r("visible",!n.visibleDflt),w=e._template||{},T=e.type||w.type||"-";"date"===T&&(a.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",n.calendar),n.noTicklabelmode||(m=r("ticklabelmode")));n.noTicklabelposition&&"multicategory"!==T||i.coerce(t,e,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:"period"===m?["outside","inside"]:"x"===y?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition"),p(e,g);var k=!e.isValidRange(t.range);k&&n.reverseDflt&&(k="reversed"),!r("autorange",k)||"linear"!==T&&"-"!==T||r("rangemode"),r("range"),e.cleanRange(),f(t,e,r,n),"category"===T||n.noHover||r("hoverformat");var M=r("color"),A=M!==l.color.dflt?M:x.color,L=b.label||g._dfltTitle[y];if(u(t,e,r,T,n,{pass:1}),!_)return e;r("title.text",L),i.coerceFont(r,"title.font",{family:x.family,size:Math.round(1.2*x.size),color:A}),s(t,e,r,T),u(t,e,r,T,n,{pass:2}),c(t,e,r,n),d(t,e,r,{dfltColor:M,bgColor:n.bgColor,showGrid:n.showGrid,attributes:l}),(e.showline||e.ticks)&&r("mirror"),n.automargin&&r("automargin");var S,C="multicategory"===T;n.noTickson||"category"!==T&&!C||!e.ticks&&!e.showgrid||(C&&(S="boundaries"),"boundaries"===r("tickson",S)&&delete e.ticklabelposition);C&&(r("showdividers")&&(r("dividercolor"),r("dividerwidth")));if("date"===T)if(o(t,e,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:v}),e.rangebreaks.length){for(var O=0;O<e.rangebreaks.length;O++)if(e.rangebreaks[O].pattern===h){e._hasDayOfWeekBreaks=!0;break}if(p(e,g),g._has("scattergl")||g._has("splom"))for(var D=0;D<n.data.length;D++){var z=n.data[D];"scattergl"!==z.type&&"splom"!==z.type||(z.visible=!1,i.warn(z.type+" traces do not work on axes with rangebreaks. Setting trace "+z.index+" to `visible: false`."))}}else delete e.rangebreaks;return e};var m={sun:1,mon:2,tue:3,wed:4,thu:5,fri:6,sat:7};function y(t){if("string"==typeof t)return m[t.substr(0,3).toLowerCase()]}},{"../../lib":233,"../../registry":326,"../array_container_defaults":274,"./category_order_defaults":283,"./constants":285,"./layout_attributes":293,"./line_grid_defaults":295,"./set_convert":299,"./tick_label_defaults":300,"./tick_mark_defaults":301,"./tick_value_defaults":302,"fast-isnumeric":23}],282:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./constants");function i(t,e){if(e&&e.length)for(var r=0;r<e.length;r++)if(e[r][t])return!0;return!1}r.id2name=function(t){if("string"==typeof t&&t.match(a.AX_ID_PATTERN)){var e=t.split(" ")[0].substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},r.name2id=function(t){if(t.match(a.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},r.cleanId=function(t,e,r){var n=/( domain)$/.test(t);if("string"==typeof t&&t.match(a.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)&&(!n||r)){var i=t.split(" ")[0].substr(1).replace(/^0+/,"");return"1"===i&&(i=""),t.charAt(0)+i+(n&&r?" domain":"")}},r.list=function(t,e,n){var a=t._fullLayout;if(!a)return[];var i,o=r.listIds(t,e),l=new Array(o.length);for(i=0;i<o.length;i++){var s=o[i];l[i]=a[s.charAt(0)+"axis"+s.substr(1)]}if(!n){var c=a._subplots.gl3d||[];for(i=0;i<c.length;i++){var u=a[c[i]];e?l.push(u[e+"axis"]):l.push(u.xaxis,u.yaxis,u.zaxis)}}return l},r.listIds=function(t,e){var r=t._fullLayout;if(!r)return[];var n=r._subplots;return e?n[e+"axis"]:n.xaxis.concat(n.yaxis)},r.getFromId=function(t,e,n){var a=t._fullLayout;return e=void 0===e||"string"!=typeof e?e:e.replace(" domain",""),"x"===n?e=e.replace(/y[0-9]*/,""):"y"===n&&(e=e.replace(/x[0-9]*/,"")),a[r.id2name(e)]},r.getFromTrace=function(t,e,a){var i=t._fullLayout,o=null;if(n.traceIs(e,"gl3d")){var l=e.scene;"scene"===l.substr(0,5)&&(o=i[l][a+"axis"])}else o=r.getFromId(t,e[a+"axis"]||a);return o},r.idSort=function(t,e){var r=t.charAt(0),n=e.charAt(0);return r!==n?r>n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},r.isLinked=function(t,e){return i(e,t._axisMatchGroups)||i(e,t._axisConstraintGroups)}},{"../../registry":326,"./constants":285}],283:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var a,i=t.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=e.categoryorder="trace"),"trace"===s?e._initialCategories=[]:"array"===s?e._initialCategories=l.slice():(l=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;n<e.data.length;n++){var l=e.data[n];l[i+"axis"]===t._id&&r.push(l)}for(n=0;n<r.length;n++){var s=r[n][i];for(a=0;a<s.length;a++){var c=s[a];null!=c&&(o[c]=1)}}return Object.keys(o)}(e,n).sort(),"category ascending"===s?e._initialCategories=l:"category descending"===s&&(e._initialCategories=l.reverse()))}}},{}],284:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical"),o=i.ONEDAY,l=i.ONEWEEK;r.dtick=function(t,e){var r="log"===e,a="date"===e,i="category"===e,l=a?o:1;if(!t)return l;if(n(t))return(t=Number(t))<=0?l:i?Math.max(1,Math.round(t)):a?Math.max(.1,t):t;if("string"!=typeof t||!a&&!r)return l;var s=t.charAt(0),c=t.substr(1);return(c=n(c)?Number(c):0)<=0||!(a&&"M"===s&&c===Math.round(c)||r&&"L"===s||r&&"D"===s&&(1===c||2===c))?l:t},r.tick0=function(t,e,r,i){return"date"===e?a.cleanDate(t,a.dateTick0(r,i%l==0?1:0)):"D1"!==i&&"D2"!==i?n(t)?Number(t):0:void 0}},{"../../constants/numerical":212,"../../lib":233,"fast-isnumeric":23}],285:[function(t,e,r){"use strict";var n=t("../../lib/regex").counter;e.exports={idRegex:{x:n("x","( domain)?"),y:n("y","( domain)?")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,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":249}],286:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./autorange"),i=t("./axis_ids").id2name,o=t("./layout_attributes"),l=t("./scale_zoom"),s=t("./set_convert"),c=t("../../constants/numerical").ALMOST_EQUAL,u=t("../../constants/alignment").FROM_BL;function f(t,e,r){var a=r.axIds,l=r.layoutOut,s=r.hasImage,c=l._axisConstraintGroups,u=l._axisMatchGroups,f=e._id,g=f.charAt(0),v=((l._splomAxes||{})[g]||{})[f]||{},m=e._id,y="x"===m.charAt(0);function x(r,a){return n.coerce(t,e,o,r,a)}e._matchGroup=null,e._constraintGroup=null,x("constrain",s?"domain":"range"),n.coerce(t,e,{constraintoward:{valType:"enumerated",values:y?["left","center","right"]:["bottom","middle","top"],dflt:y?"center":"middle"}},"constraintoward");var b,_,w=e.type,T=[];for(b=0;b<a.length;b++){if((_=a[b])!==m)l[i(_)].type===w&&T.push(_)}var k=p(c,m);if(k){var M=[];for(b=0;b<T.length;b++)k[_=T[b]]||M.push(_);T=M}var A,L,S=T.length;S&&(t.matches||v.matches)&&(A=n.coerce(t,e,{matches:{valType:"enumerated",values:T,dflt:-1!==T.indexOf(v.matches)?v.matches:void 0}},"matches"));var C=s&&!y?e.anchor:void 0;if(S&&!A&&(t.scaleanchor||C)&&(L=n.coerce(t,e,{scaleanchor:{valType:"enumerated",values:T}},"scaleanchor",C)),A){e._matchGroup=h(u,m,A,1);var O=l[i(A)],D=d(l,e)/d(l,O);y!==("x"===A.charAt(0))&&(D=(y?"x":"y")+D),h(c,m,A,D)}else t.matches&&-1!==a.indexOf(t.matches)&&n.warn("ignored "+e._name+'.matches: "'+t.matches+'" to avoid an infinite loop');if(L){var z=x("scaleratio");z||(z=e.scaleratio=1),h(c,m,L,z)}else t.scaleanchor&&-1!==a.indexOf(t.scaleanchor)&&n.warn("ignored "+e._name+'.scaleanchor: "'+t.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.')}function d(t,e){var r=e.domain;return r||(r=t[i(e.overlaying)].domain),r[1]-r[0]}function p(t,e){for(var r=0;r<t.length;r++)if(t[r][e])return t[r];return null}function h(t,e,r,n){var a,i,o,l,s,c=p(t,e);null===c?((c={})[e]=1,s=t.length,t.push(c)):s=t.indexOf(c);var u=Object.keys(c);for(a=0;a<t.length;a++)if(o=t[a],a!==s&&o[r]){var f=o[r];for(i=0;i<u.length;i++)o[l=u[i]]=g(f,g(n,c[l]));return void t.splice(s,1)}if(1!==n)for(i=0;i<u.length;i++){var d=u[i];c[d]=g(n,c[d])}c[r]=1}function g(t,e){var r,n,a="",i="";"string"==typeof t&&(r=(a=t.match(/^[xy]*/)[0]).length,t=+t.substr(r)),"string"==typeof e&&(n=(i=e.match(/^[xy]*/)[0]).length,e=+e.substr(n));var o=t*e;return r||n?r&&n&&a.charAt(0)!==i.charAt(0)?r===n?o:(r>n?a.substr(n):i.substr(r))+o:a+i+t*e:o}function v(t,e){for(var r=e._size,n=r.h/r.w,a={},i=Object.keys(t),o=0;o<i.length;o++){var l=i[o],s=t[l];if("string"==typeof s){var c=s.match(/^[xy]*/)[0],u=c.length;s=+s.substr(u);for(var f="y"===c.charAt(0)?n:1/n,d=0;d<u;d++)s*=f}a[l]=s}return a}function m(t,e){var r=t._inputDomain,n=u[t.constraintoward],a=r[0]+(r[1]-r[0])*n;t.domain=t._input.domain=[a+(r[0]-a)/e,a+(r[1]-a)/e],t.setScale()}r.handleDefaults=function(t,e,r){var a,o,l,c,u,d,p,h,g=r.axIds,v=r.axHasImage,m=e._axisConstraintGroups=[],y=e._axisMatchGroups=[];for(a=0;a<g.length;a++)f(u=t[c=i(g[a])],d=e[c],{axIds:g,layoutOut:e,hasImage:v[c]});function x(t,r){for(a=0;a<t.length;a++)for(l in o=t[a])e[i(l)][r]=o}for(x(y,"_matchGroup"),a=0;a<m.length;a++)for(l in o=m[a])if((d=e[i(l)]).fixedrange){for(var b in o){var _=i(b);!1===(t[_]||{}).fixedrange&&n.warn("fixedrange was specified as false for axis "+_+" but was overridden because another axis in its constraint group has fixedrange true"),e[_].fixedrange=!0}break}for(a=0;a<m.length;){for(l in o=m[a]){(d=e[i(l)])._matchGroup&&Object.keys(d._matchGroup).length===Object.keys(o).length&&(m.splice(a,1),a--);break}a++}x(m,"_constraintGroup");var w=["constrain","range","autorange","rangemode","rangebreaks","categoryorder","categoryarray"],T=!1,k=!1;function M(){h=d[p],"rangebreaks"===p&&(k=d._hasDayOfWeekBreaks)}for(a=0;a<y.length;a++){o=y[a];for(var A=0;A<w.length;A++){var L;for(l in p=w[A],h=null,o)if(u=t[c=i(l)],d=e[c],p in d){if(!d.matches&&(L=d,p in u)){M();break}null===h&&p in u&&M()}if("range"===p&&h&&(T=!0),"autorange"===p&&null===h&&T&&(h=!1),null===h&&p in L&&(h=L[p]),null!==h)for(l in o)(d=e[i(l)])[p]="range"===p?h.slice():h,"rangebreaks"===p&&(d._hasDayOfWeekBreaks=k,s(d,e))}}},r.enforce=function(t){var e,r,n,o,s,u,f,d,p=t._fullLayout,h=p._axisConstraintGroups||[];for(e=0;e<h.length;e++){n=v(h[e],p);var g=Object.keys(n),y=1/0,x=0,b=1/0,_={},w={},T=!1;for(r=0;r<g.length;r++)w[o=g[r]]=s=p[i(o)],s._inputDomain?s.domain=s._inputDomain.slice():s._inputDomain=s.domain.slice(),s._inputRange||(s._inputRange=s.range.slice()),s.setScale(),_[o]=u=Math.abs(s._m)/n[o],y=Math.min(y,u),"domain"!==s.constrain&&s._constraintShrinkable||(b=Math.min(b,u)),delete s._constraintShrinkable,x=Math.max(x,u),"domain"===s.constrain&&(T=!0);if(!(y>c*x)||T)for(r=0;r<g.length;r++)if(u=_[o=g[r]],f=(s=w[o]).constrain,u!==b||"domain"===f)if(d=u/b,"range"===f)l(s,d);else{var k=s._inputDomain,M=(s.domain[1]-s.domain[0])/(k[1]-k[0]),A=(s.r2l(s.range[1])-s.r2l(s.range[0]))/(s.r2l(s._inputRange[1])-s.r2l(s._inputRange[0]));if((d/=M)*A<1){s.domain=s._input.domain=k.slice(),l(s,d);continue}if(A<1&&(s.range=s._input.range=s._inputRange.slice(),d*=A),s.autorange){var L=s.r2l(s.range[0]),S=s.r2l(s.range[1]),C=(L+S)/2,O=C,D=C,z=Math.abs(S-C),P=C-z*d*1.0001,E=C+z*d*1.0001,I=a.makePadFn(p,s,0),R=a.makePadFn(p,s,1);m(s,d);var F,N,B=Math.abs(s._m),H=a.concatExtremes(t,s),j=H.min,U=H.max;for(N=0;N<j.length;N++)(F=j[N].val-I(j[N])/B)>P&&F<O&&(O=F);for(N=0;N<U.length;N++)(F=U[N].val+R(U[N])/B)<E&&F>D&&(D=F);d/=(D-O)/(2*z),O=s.l2r(O),D=s.l2r(D),s.range=s._input.range=L<S?[O,D]:[D,O]}m(s,d)}}},r.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n<r.length;n++){if(r[n][e])return"g"+n}return e},r.clean=function(t,e){if(e._inputDomain){for(var r=!1,n=e._id,a=t._fullLayout._axisConstraintGroups,i=0;i<a.length;i++)if(a[i][n]){r=!0;break}r&&"domain"===e.constrain||(e._input.domain=e.domain=e._inputDomain,delete e._inputDomain)}}},{"../../constants/alignment":207,"../../constants/numerical":212,"../../lib":233,"./autorange":278,"./axis_ids":282,"./layout_attributes":293,"./scale_zoom":297,"./set_convert":299}],287:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("has-passive-events"),o=t("../../registry"),l=t("../../lib"),s=l.strTranslate,c=t("../../lib/svg_text_utils"),u=t("../../components/color"),f=t("../../components/drawing"),d=t("../../components/fx"),p=t("./axes"),h=t("../../lib/setcursor"),g=t("../../components/dragelement"),v=t("../../components/dragelement/helpers"),m=v.selectingOrDrawing,y=v.freeMode,x=t("../../constants/alignment").FROM_TL,b=t("../../lib/clear_gl_canvases"),_=t("../../plot_api/subroutines").redrawReglTraces,w=t("../plots"),T=t("./axis_ids").getFromId,k=t("./select").prepSelect,M=t("./select").clearSelect,A=t("./select").selectOnClick,L=t("./scale_zoom"),S=t("./constants"),C=S.MINDRAG,O=S.MINZOOM,D=!0;function z(t,e,r,n){var a=l.ensureSingle(t.draglayer,e,r,(function(e){e.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id)}));return a.call(h,n),a.node()}function P(t,e,r,a,i,o,l){var s=z(t,"rect",e,r);return n.select(s).call(f.setRect,a,i,o,l),s}function E(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function I(t,e,r,n,a){for(var i=0;i<t.length;i++){var o=t[i];if(!o.fixedrange)if(o.rangebreaks){var l="y"===o._id.charAt(0),s=l?1-e:e,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*e),n[o._name+".range[1]"]=o.l2r(u+f*r)}}if(a&&a.length){var d=(e+(1-r))/2;I(a,d,1-d,n,[])}}function R(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(!n.fixedrange)if(n.rangebreaks){var a=n._length,i=(n.p2l(0+e)-n.p2l(0)+(n.p2l(a+e)-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]-e/n._m),n.l2r(n._rl[1]-e/n._m)]}}function F(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",s(r,n)).attr("d",a+"Z")}function B(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform",s(e,r)).attr("d","M0,0Z")}function H(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),j(t,e,a,i)}function j(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function U(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(t){D&&t.data&&t._context.showTips&&(l.notifier(l._(t,"Double-click to zoom back out"),"long"),D=!1)}function q(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,O)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function G(t,e,r,n,a){for(var i,o,s,c,u=!1,f={},d={},p=(a||{}).xaHash,h=(a||{}).yaHash,g=0;g<e.length;g++){var v=e[g];for(i in r)if(v[i]){for(s in v)a&&(p[s]||h[s])||("x"===s.charAt(0)?r:n)[s]||(f[s]=i);for(o in n)a&&(p[o]||h[o])||!v[o]||(u=!0)}for(o in n)if(v[o])for(c in v)a&&(p[c]||h[c])||("x"===c.charAt(0)?r:n)[c]||(d[c]=o)}u&&(l.extendFlat(f,d),d={});var m={},y=[];for(s in f){var x=T(t,s);y.push(x),m[x._id]=x}var b={},_=[];for(c in d){var w=T(t,c);_.push(w),b[w._id]=w}return{xaHash:m,yaHash:b,xaxes:y,yaxes:_,xLinks:f,yLinks:d,isSubplotConstrained:u}}function Z(t,e){if(i){var r=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel?t.onmousewheel=e:t.isAddedWheelEvent||(t.isAddedWheelEvent=!0,t.addEventListener("wheel",e,{passive:!1}))}function Y(t){var e=[];for(var r in t)e.push(t[r]);return e}e.exports={makeDragBox:function(t,e,r,i,s,u,h,v){var D,z,j,X,W,Q,J,$,K,tt,et,rt,nt,at,it,ot,lt,st,ct,ut,ft,dt,pt,ht=t._fullLayout._zoomlayer,gt=h+v==="nsew",vt=1===(h+v).length;function mt(){if(D=e.xaxis,z=e.yaxis,K=D._length,tt=z._length,J=D._offset,$=z._offset,(j={})[D._id]=D,(X={})[z._id]=z,h&&v)for(var r=e.overlays,n=0;n<r.length;n++){var a=r[n].xaxis;j[a._id]=a;var i=r[n].yaxis;X[i._id]=i}W=Y(j),Q=Y(X),nt=E(W,v),at=E(Q,h),it=!at&&!nt,rt=G(t,t._fullLayout._axisMatchGroups,j,X);var o=(et=G(t,t._fullLayout._axisConstraintGroups,j,X,rt)).isSubplotConstrained||rt.isSubplotConstrained;ot=v||o,lt=h||o;var l=t._fullLayout;st=l._has("scattergl"),ct=l._has("splom"),ut=l._has("svg")}mt();var yt=function(t,e,r){if(!t)return"pointer";if("nsew"===t)return r?"":"pan"===e?"move":"crosshair";return t.toLowerCase()+"-resize"}(at+nt,t._fullLayout.dragmode,gt),xt=P(e,h+v+"drag",yt,r,i,s,u);if(it&&!gt)return xt.onmousedown=null,xt.style.pointerEvents="none",xt;var bt,_t,wt,Tt,kt,Mt,At,Lt,St,Ct,Ot={element:xt,gd:t,plotinfo:e};function Dt(){Ot.plotinfo.selection=!1,M(t)}function zt(t,r){var a=Ot.gd;if(a._fullLayout._activeShapeIndex>=0)a._fullLayout._deactivateShape(a);else{var i=a._fullLayout.clickmode;if(U(a),2!==t||vt||Vt(),gt)i.indexOf("select")>-1&&A(r,a,W,Q,e.id,Ot),i.indexOf("event")>-1&&d.click(a,r,e.id);else if(1===t&&vt){var l=h?z:D,s="s"===h||"w"===v?0:1,u=l._name+".range["+s+"]",f=function(t,e){var r,a=t.range[e],i=Math.abs(a-t.range[1-e]);return"date"===t.type?a:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(l,s),p="left",g="middle";if(l.fixedrange)return;h?(g="n"===h?"top":"bottom","right"===l.side&&(p="right")):"e"===v&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(xt).call(c.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(f),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:p,verticalAlign:g}).on("edit",(function(t){var e=l.d2r(t);void 0!==e&&o.call("_guiRelayout",a,u,e)}))}}}function Pt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(K,dt*e+bt)),a=Math.max(0,Math.min(tt,pt*r+_t)),i=Math.abs(n-bt),o=Math.abs(a-_t);function l(){At="",wt.r=wt.l,wt.t=wt.b,St.attr("d","M0,0Z")}if(wt.l=Math.min(bt,n),wt.r=Math.max(bt,n),wt.t=Math.min(_t,a),wt.b=Math.max(_t,a),et.isSubplotConstrained)i>O||o>O?(At="xy",i/K>o/tt?(o=i*tt/K,_t>a?wt.t=_t-o:wt.b=_t+o):(i=o*K/tt,bt>n?wt.l=bt-i:wt.r=bt+i),St.attr("d",q(wt))):l();else if(rt.isSubplotConstrained)if(i>O||o>O){At="xy";var s=Math.min(wt.l/K,(tt-wt.b)/tt),c=Math.max(wt.r/K,(tt-wt.t)/tt);wt.l=s*K,wt.r=c*K,wt.b=(1-s)*tt,wt.t=(1-c)*tt,St.attr("d",q(wt))}else l();else!at||o<Math.min(Math.max(.6*i,C),O)?i<C||!nt?l():(wt.t=0,wt.b=tt,At="x",St.attr("d",function(t,e){return"M"+(t.l-.5)+","+(e-O-.5)+"h-3v"+(2*O+1)+"h3ZM"+(t.r+.5)+","+(e-O-.5)+"h3v"+(2*O+1)+"h-3Z"}(wt,_t))):!nt||i<Math.min(.6*o,O)?(wt.l=0,wt.r=K,At="y",St.attr("d",function(t,e){return"M"+(e-O-.5)+","+(t.t-.5)+"v-3h"+(2*O+1)+"v3ZM"+(e-O-.5)+","+(t.b+.5)+"v3h"+(2*O+1)+"v-3Z"}(wt,bt))):(At="xy",St.attr("d",q(wt)));wt.w=wt.r-wt.l,wt.h=wt.b-wt.t,At&&(Ct=!0),t._dragged=Ct,H(Lt,St,wt,kt,Mt,Tt),Et(),t.emit("plotly_relayouting",ft),Mt=!0}function Et(){ft={},"xy"!==At&&"x"!==At||(I(W,wt.l/K,wt.r/K,ft,et.xaxes),jt("x",ft)),"xy"!==At&&"y"!==At||(I(Q,(tt-wt.b)/tt,(tt-wt.t)/tt,ft,et.yaxes),jt("y",ft))}function It(){Et(),U(t),qt(),V(t)}Ot.prepFn=function(e,r,n){var i=Ot.dragmode,o=t._fullLayout.dragmode;o!==i&&(Ot.dragmode=o),mt(),dt=t._fullLayout._invScaleX,pt=t._fullLayout._invScaleY,it||(gt?e.shiftKey?"pan"===o?o="zoom":m(o)||(o="pan"):e.ctrlKey&&(o="pan"):o="pan"),y(o)?Ot.minDrag=1:Ot.minDrag=void 0,m(o)?(Ot.xaxes=W,Ot.yaxes=Q,k(e,r,n,Ot,o)):(Ot.clickFn=zt,m(i)&&Dt(),it||("zoom"===o?(Ot.moveFn=Pt,Ot.doneFn=It,Ot.minDrag=1,function(e,r,n){var i=xt.getBoundingClientRect();bt=r-i.left,_t=n-i.top,t._fullLayout._calcInverseTransform(t);var o=l.apply3DTransform(t._fullLayout._invTransform)(bt,_t);bt=o[0],_t=o[1],wt={l:bt,r:bt,w:0,t:_t,b:_t,h:0},Tt=t._hmpixcount?t._hmlumcount/t._hmpixcount:a(t._fullLayout.plot_bgcolor).getLuminance(),Mt=!1,At="xy",Ct=!1,Lt=N(ht,Tt,J,$,kt="M0,0H"+K+"V"+tt+"H0V0"),St=B(ht,J,$)}(0,r,n)):"pan"===o&&(Ot.moveFn=Ht,Ot.doneFn=qt))),t._fullLayout._redrag=function(){var e=t._dragdata;if(e&&e.element===xt){var r=t._fullLayout.dragmode;m(r)||(mt(),Gt([0,0,K,tt]),Ot.moveFn(e.dx,e.dy))}}},g.init(Ot);var Rt=[0,0,K,tt],Ft=null,Nt=S.REDRAWDELAY,Bt=e.mainplot?t._fullLayout._plots[e.mainplot]:e;function Ht(e,r){if(e*=dt,r*=pt,!t._transitioningWithDuration){if(t._fullLayout._replotting=!0,"ew"===nt||"ns"===at){var n=nt?-e:0,a=at?-r:0;if(rt.isSubplotConstrained){if(nt&&at){var i=(e/K-r/tt)/2;n=-(e=i*K),a=-(r=-i*tt)}at?n=-a*K/tt:a=-n*tt/K}return nt&&(R(W,e),jt("x")),at&&(R(Q,r),jt("y")),Gt([n,a,K,tt]),Ut(),void t.emit("plotly_relayouting",ft)}var o,l,s="w"===nt==("n"===at)?1:-1;if(nt&&at&&(et.isSubplotConstrained||rt.isSubplotConstrained)){var c=(e/K+s*r/tt)/2;e=c*K,r=s*c*tt}if("w"===nt?e=p(W,0,e):"e"===nt?e=p(W,1,-e):nt||(e=0),"n"===at?r=p(Q,1,r):"s"===at?r=p(Q,0,-r):at||(r=0),o="w"===nt?e:0,l="n"===at?r:0,et.isSubplotConstrained&&!rt.isSubplotConstrained||rt.isSubplotConstrained&&nt&&at&&s>0){var u;if(rt.isSubplotConstrained||!nt&&1===at.length){for(u=0;u<W.length;u++)W[u].range=W[u]._r.slice(),L(W[u],1-r/tt);o=(e=r*K/tt)/2}if(rt.isSubplotConstrained||!at&&1===nt.length){for(u=0;u<Q.length;u++)Q[u].range=Q[u]._r.slice(),L(Q[u],1-e/K);l=(r=e*tt/K)/2}}rt.isSubplotConstrained&&at||jt("x"),rt.isSubplotConstrained&&nt||jt("y");var f=K-e,d=tt-r;!rt.isSubplotConstrained||nt&&at||(nt?(l=o?0:e*tt/K,d=f*tt/K):(o=l?0:r*K/tt,f=d*K/tt)),Gt([o,l,f,d]),Ut(),t.emit("plotly_relayouting",ft)}function p(t,e,r){for(var n,a,i=1-e,o=0;o<t.length;o++){var l=t[o];if(!l.fixedrange){n=l,a=l._rl[i]+(l._rl[e]-l._rl[i])/F(r/l._length);var s=l.l2r(a);!1!==s&&void 0!==s&&(l.range[e]=s)}}return n._length*(n._rl[e]-a)/(n._rl[e]-n._rl[i])}}function jt(t,e){for(var r=rt.isSubplotConstrained?{x:Q,y:W}[t]:rt[t+"axes"],n=rt.isSubplotConstrained?{x:W,y:Q}[t]:[],a=0;a<r.length;a++){var i=r[a],o=i._id,l=rt.xLinks[o]||rt.yLinks[o],s=n[0]||j[l]||X[l];s&&(e?(e[i._name+".range[0]"]=e[s._name+".range[0]"],e[i._name+".range[1]"]=e[s._name+".range[1]"]):i.range=s.range.slice())}}function Ut(){var e,r=[];function n(t){for(e=0;e<t.length;e++)t[e].fixedrange||r.push(t[e]._id)}for(ot&&(n(W),n(et.xaxes),n(rt.xaxes)),lt&&(n(Q),n(et.yaxes),n(rt.yaxes)),ft={},e=0;e<r.length;e++){var a=r[e],i=T(t,a);p.drawOne(t,i,{skipTitle:!0}),ft[i._name+".range[0]"]=i.range[0],ft[i._name+".range[1]"]=i.range[1]}p.redrawComponents(t,r)}function Vt(){if(!t._transitioningWithDuration){var e=t._context.doubleClick,r=[];nt&&(r=r.concat(W)),at&&(r=r.concat(Q)),rt.xaxes&&(r=r.concat(rt.xaxes)),rt.yaxes&&(r=r.concat(rt.yaxes));var n,a,i,l={};if("reset+autosize"===e)for(e="autosize",a=0;a<r.length;a++)if((n=r[a])._rangeInitial&&(n.range[0]!==n._rangeInitial[0]||n.range[1]!==n._rangeInitial[1])||!n._rangeInitial&&!n.autorange){e="reset";break}if("autosize"===e)for(a=0;a<r.length;a++)(n=r[a]).fixedrange||(l[n._name+".autorange"]=!0);else if("reset"===e)for((nt||et.isSubplotConstrained)&&(r=r.concat(et.xaxes)),at&&!et.isSubplotConstrained&&(r=r.concat(et.yaxes)),et.isSubplotConstrained&&(nt?at||(r=r.concat(Q)):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);t.emit("plotly_doubleclick",null),o.call("_guiRelayout",t,l)}}function qt(){Gt([0,0,K,tt]),l.syncOrAsync([w.previousPromises,function(){t._fullLayout._replotting=!1,o.call("_guiRelayout",t,ft)}],t)}function Gt(e){var r,n,a,i,s=t._fullLayout,c=s._plots,u=s._subplots.cartesian;if(ct&&o.subplotsRegistry.splom.drag(t),st)for(r=0;r<u.length;r++)if(a=(n=c[u[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((ct||st)&&(b(t),_(t)),ut){var g=e[2]/D._length,m=e[3]/z._length;for(r=0;r<u.length;r++){a=(n=c[u[r]]).xaxis,i=n.yaxis;var y,x,w,T,k=(ot||rt.isSubplotConstrained)&&!a.fixedrange&&j[a._id],M=(lt||rt.isSubplotConstrained)&&!i.fixedrange&&X[i._id];if(k?(y=g,w=v||rt.isSubplotConstrained?e[0]:Xt(a,y)):rt.xaHash[a._id]?(y=g,w=e[0]*a._length/D._length):rt.yaHash[a._id]?(y=m,w="ns"===at?-e[1]*a._length/z._length:Xt(a,y,{n:"top",s:"bottom"}[at])):w=Yt(a,y=Zt(a,g,m)),M?(x=m,T=h||rt.isSubplotConstrained?e[1]:Xt(i,x)):rt.yaHash[i._id]?(x=m,T=e[1]*i._length/z._length):rt.xaHash[i._id]?(x=g,T="ew"===nt?-e[0]*i._length/D._length:Xt(i,x,{e:"right",w:"left"}[nt])):T=Yt(i,x=Zt(i,g,m)),y||x){y||(y=1),x||(x=1);var A=a._offset-w/y,L=i._offset-T/x;n.clipRect.call(f.setTranslate,w,T).call(f.setScale,y,x),n.plot.call(f.setTranslate,A,L).call(f.setScale,1/y,1/x),y===n.xScaleFactor&&x===n.yScaleFactor||(f.setPointGroupScale(n.zoomScalePts,y,x),f.setTextPointsScale(n.zoomScaleTxt,y,x)),f.hideOutsideRangePoints(n.clipOnAxisFalseTraces,n),n.xScaleFactor=y,n.yScaleFactor=x}}}}function Zt(t,e,r){return t.fixedrange?0:ot&&et.xaHash[t._id]?e:lt&&(et.isSubplotConstrained?et.xaHash:et.yaHash)[t._id]?r:0}function Yt(t,e){return e?(t.range=t._r.slice(),L(t,e),Xt(t,e)):0}function Xt(t,e,r){return t._length*(1-e)*x[r||t.constraintoward||"middle"]}return h.length*v.length!=1&&Z(xt,(function(e){if(t._context._scrollZoom.cartesian||t._fullLayout._enablescrollzoom){if(Dt(),t._transitioningWithDuration)return e.preventDefault(),void e.stopPropagation();mt(),clearTimeout(Ft);var r=-e.deltaY;if(isFinite(r)||(r=e.wheelDelta/10),isFinite(r)){var n,a=Math.exp(-Math.min(Math.max(r,-20),20)/200),i=Bt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),o=(e.clientX-i.left)/i.width,s=(i.bottom-e.clientY)/i.height;if(ot){for(v||(o=.5),n=0;n<W.length;n++)c(W[n],o,a);jt("x"),Rt[2]*=a,Rt[0]+=Rt[2]*o*(1/a-1)}if(lt){for(h||(s=.5),n=0;n<Q.length;n++)c(Q[n],s,a);jt("y"),Rt[3]*=a,Rt[1]+=Rt[3]*(1-s)*(1/a-1)}Gt(Rt),Ut(),t.emit("plotly_relayouting",ft),Ft=setTimeout((function(){Rt=[0,0,K,tt],qt()}),Nt),e.preventDefault()}else l.log("Did not find wheel motion attributes: ",e)}function c(t,e,r){if(!t.fixedrange){var n=l.simpleMap(t.range,t.r2l),a=n[0]+(n[1]-n[0])*e;t.range=n.map((function(e){return t.l2r(a+(e-a)*r)}))}}})),xt},makeDragger:z,makeRectDragger:P,makeZoombox:N,makeCorners:B,updateZoombox:H,xyCorners:q,transitionZoombox:j,removeZoombox:U,showDoubleClickNotifier:V,attachWheelEventHandler:Z}},{"../../components/color":105,"../../components/dragelement":124,"../../components/dragelement/helpers":123,"../../components/drawing":127,"../../components/fx":145,"../../constants/alignment":207,"../../lib":233,"../../lib/clear_gl_canvases":221,"../../lib/setcursor":253,"../../lib/svg_text_utils":255,"../../plot_api/subroutines":269,"../../registry":326,"../plots":313,"./axes":279,"./axis_ids":282,"./constants":285,"./scale_zoom":297,"./select":298,d3:21,"has-passive-events":55,tinycolor2:88}],288:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/fx"),i=t("../../components/dragelement"),o=t("../../lib/setcursor"),l=t("./dragbox").makeDragBox,s=t("./constants").DRAGGERSIZE;r.initInteractions=function(t){var e=t._fullLayout;if(t._context.staticPlot)n.select(t).selectAll(".drag").remove();else if(e._has("cartesian")||e._has("splom")){Object.keys(e._plots||{}).sort((function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),a=r.split("y");return n[0]===a[0]?Number(n[1]||1)-Number(a[1]||1):Number(n[0]||1)-Number(a[0]||1)}return e._plots[t].mainplot?1:-1})).forEach((function(r){var n=e._plots[r],o=n.xaxis,c=n.yaxis;if(!n.mainplot){var u=l(t,n,o._offset,c._offset,o._length,c._length,"ns","ew");u.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&t._fullLayout._plots[r]&&a.hover(t,e,r)},a.hover(t,e,r),t._fullLayout._lasthover=u,t._fullLayout._hoversubplot=r},u.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,i.unhover(t,e))},t._context.showAxisDragHandles&&(l(t,n,o._offset-s,c._offset-s,s,s,"n","w"),l(t,n,o._offset+o._length,c._offset-s,s,s,"n","e"),l(t,n,o._offset-s,c._offset+c._length,s,s,"s","w"),l(t,n,o._offset+o._length,c._offset+c._length,s,s,"s","e"))}if(t._context.showAxisDragHandles){if(r===o._mainSubplot){var f=o._mainLinePosition;"top"===o.side&&(f-=s),l(t,n,o._offset+.1*o._length,f,.8*o._length,s,"","ew"),l(t,n,o._offset,f,.1*o._length,s,"","w"),l(t,n,o._offset+.9*o._length,f,.1*o._length,s,"","e")}if(r===c._mainSubplot){var d=c._mainLinePosition;"right"!==c.side&&(d-=s),l(t,n,d,c._offset+.1*c._length,s,.8*c._length,"ns",""),l(t,n,d,c._offset+.9*c._length,s,.1*c._length,"s",""),l(t,n,d,c._offset,s,.1*c._length,"n","")}}}));var o=e._hoverlayer.node();o.onmousemove=function(r){r.target=t._fullLayout._lasthover,a.hover(t,r,e._hoversubplot)},o.onclick=function(e){e.target=t._fullLayout._lasthover,a.click(t,e)},o.onmousedown=function(e){t._fullLayout._lasthover.onmousedown(e)},r.updateFx(t)}},r.updateFx=function(t){var e=t._fullLayout,r="pan"===e.dragmode?"move":"crosshair";o(e._draggers,r)}},{"../../components/dragelement":124,"../../components/fx":145,"../../lib/setcursor":253,"./constants":285,"./dragbox":287,d3:21}],289:[function(t,e,r){"use strict";e.exports={clearOutlineControllers:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".outline-controllers").remove()},clearSelect:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".select-outline").remove(),t._fullLayout._drawing=!1}}},{}],290:[function(t,e,r){"use strict";var n=t("../../lib").strTranslate;function a(t,e){switch(t.type){case"log":return t.p2d(e);case"date":return t.p2r(e,0,t.calendar);default:return t.p2r(e)}}e.exports={p2r:a,r2p:function(t,e){switch(t.type){case"log":return t.d2p(e);case"date":return t.r2p(e,0,t.calendar);default:return t.r2p(e)}},axValue:function(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return a(t,r[e])}},getTransform:function(t){return n(t.xaxis._offset,t.yaxis._offset)}}},{"../../lib":233}],291:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("./axis_ids");e.exports=function(t){return function(e,r){var o=e[t];if(Array.isArray(o))for(var l=n.subplotsRegistry.cartesian,s=l.idRegex,c=r._subplots,u=c.xaxis,f=c.yaxis,d=c.cartesian,p=r._has("cartesian")||r._has("gl2d"),h=0;h<o.length;h++){var g=o[h];if(a.isPlainObject(g)){var v=i.cleanId(g.xref,"x",!1),m=i.cleanId(g.yref,"y",!1),y=s.x.test(v),x=s.y.test(m);if(y||x){p||a.pushUnique(r._basePlotModules,l);var b=!1;y&&-1===u.indexOf(v)&&(u.push(v),b=!0),x&&-1===f.indexOf(m)&&(f.push(m),b=!0),b&&y&&x&&d.push(v+m)}}}}}},{"../../lib":233,"../../registry":326,"./axis_ids":282}],292:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=t("../plots"),l=t("../../components/drawing"),s=t("../get_data").getModuleCalcData,c=t("./axis_ids"),u=t("./constants"),f=t("../../constants/xmlns_namespaces"),d=i.ensureSingle;function p(t,e,r){return i.ensureSingle(t,e,r,(function(t){t.datum(r)}))}function h(t,e,r,i,o){for(var c,f,d,p=u.traceLayerClasses,h=t._fullLayout,g=h._modules,v=[],m=[],y=0;y<g.length;y++){var x=(c=g[y]).name,b=a.modules[x].categories;if(b.svg){var _=c.layerName||x+"layer",w=c.plot;d=(f=s(r,w))[0],r=f[1],d.length&&v.push({i:p.indexOf(_),className:_,plotMethod:w,cdModule:d}),b.zoomScale&&m.push("."+_)}}v.sort((function(t,e){return t.i-e.i}));var T=e.plot.selectAll("g.mlayer").data(v,(function(t){return t.className}));if(T.enter().append("g").attr("class",(function(t){return t.className})).classed("mlayer",!0).classed("rangeplot",e.isRangePlot),T.exit().remove(),T.order(),T.each((function(r){var a=n.select(this),s=r.className;r.plotMethod(t,e,r.cdModule,a,i,o),-1===u.clipOnAxisFalseQuery.indexOf("."+s)&&l.setClipUrl(a,e.layerClipId,t)})),h._has("scattergl")&&(c=a.getModule("scattergl"),d=s(r,c)[0],c.plot(t,e,d)),!t._context.staticPlot&&(e._hasClipOnAxisFalse&&(e.clipOnAxisFalseTraces=e.plot.selectAll(u.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),m.length)){var k=e.plot.selectAll(m.join(",")).selectAll(".trace");e.zoomScalePts=k.selectAll("path.point"),e.zoomScaleTxt=k.selectAll(".textpoint")}}function g(t,e){var r=e.plotgroup,n=e.id,a=u.layerValue2layerClass[e.xaxis.layer],i=u.layerValue2layerClass[e.yaxis.layer],o=t._fullLayout._hasOnlyLargeSploms;if(e.mainplot){var l=e.mainplotinfo,s=l.plotgroup,f=n+"-x",h=n+"-y";e.gridlayer=l.gridlayer,e.zerolinelayer=l.zerolinelayer,d(l.overlinesBelow,"path",f),d(l.overlinesBelow,"path",h),d(l.overaxesBelow,"g",f),d(l.overaxesBelow,"g",h),e.plot=d(l.overplot,"g",n),d(l.overlinesAbove,"path",f),d(l.overlinesAbove,"path",h),d(l.overaxesAbove,"g",f),d(l.overaxesAbove,"g",h),e.xlines=s.select(".overlines-"+a).select("."+f),e.ylines=s.select(".overlines-"+i).select("."+h),e.xaxislayer=s.select(".overaxes-"+a).select("."+f),e.yaxislayer=s.select(".overaxes-"+i).select("."+h)}else if(o)e.xlines=d(r,"path","xlines-above"),e.ylines=d(r,"path","ylines-above"),e.xaxislayer=d(r,"g","xaxislayer-above"),e.yaxislayer=d(r,"g","yaxislayer-above");else{var g=d(r,"g","layer-subplot");e.shapelayer=d(g,"g","shapelayer"),e.imagelayer=d(g,"g","imagelayer"),e.gridlayer=d(r,"g","gridlayer"),e.zerolinelayer=d(r,"g","zerolinelayer"),d(r,"path","xlines-below"),d(r,"path","ylines-below"),e.overlinesBelow=d(r,"g","overlines-below"),d(r,"g","xaxislayer-below"),d(r,"g","yaxislayer-below"),e.overaxesBelow=d(r,"g","overaxes-below"),e.plot=d(r,"g","plot"),e.overplot=d(r,"g","overplot"),e.xlines=d(r,"path","xlines-above"),e.ylines=d(r,"path","ylines-above"),e.overlinesAbove=d(r,"g","overlines-above"),d(r,"g","xaxislayer-above"),d(r,"g","yaxislayer-above"),e.overaxesAbove=d(r,"g","overaxes-above"),e.xlines=r.select(".xlines-"+a),e.ylines=r.select(".ylines-"+i),e.xaxislayer=r.select(".xaxislayer-"+a),e.yaxislayer=r.select(".yaxislayer-"+i)}o||(p(e.gridlayer,"g",e.xaxis._id),p(e.gridlayer,"g",e.yaxis._id),e.gridlayer.selectAll("g").map((function(t){return t[0]})).sort(c.idSort)),e.xlines.style("fill","none").classed("crisp",!0),e.ylines.style("fill","none").classed("crisp",!0)}function v(t,e){if(t){var r={};for(var a in t.each((function(t){var a=t[0];n.select(this).remove(),m(a,e),r[a]=!0})),e._plots)for(var i=e._plots[a].overlays||[],o=0;o<i.length;o++){var l=i[o];r[l.id]&&l.plot.selectAll(".trace").remove()}}}function m(t,e){e._draggers.selectAll("g."+t).remove(),e._defs.select("#clip"+e._uid+t+"plot").remove()}r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=u.idRegex,r.attrRegex=u.attrRegex,r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.transitionAxes=t("./transition_axes"),r.finalizeSubplots=function(t,e){var r,n,a,o=e._subplots,l=o.xaxis,s=o.yaxis,f=o.cartesian,d=f.concat(o.gl2d||[]),p={},h={};for(r=0;r<d.length;r++){var g=d[r].split("y");p[g[0]]=1,h["y"+g[1]]=1}for(r=0;r<l.length;r++)p[n=l[r]]||(a=(t[c.id2name(n)]||{}).anchor,u.idRegex.y.test(a)||(a="y"),f.push(n+a),d.push(n+a),h[a]||(h[a]=1,i.pushUnique(s,a)));for(r=0;r<s.length;r++)h[a=s[r]]||(n=(t[c.id2name(a)]||{}).anchor,u.idRegex.x.test(n)||(n="x"),f.push(n+a),d.push(n+a),p[n]||(p[n]=1,i.pushUnique(l,n)));if(!d.length){for(var v in n="",a="",t){if(u.attrRegex.test(v))"x"===v.charAt(0)?(!n||+v.substr(5)<+n.substr(5))&&(n=v):(!a||+v.substr(5)<+a.substr(5))&&(a=v)}n=n?c.name2id(n):"x",a=a?c.name2id(a):"y",l.push(n),s.push(a),f.push(n+a)}},r.plot=function(t,e,r,n){var a,i=t._fullLayout,o=i._subplots.cartesian,l=t.calcdata;if(!Array.isArray(e))for(e=[],a=0;a<l.length;a++)e.push(a);for(a=0;a<o.length;a++){for(var s,c=o[a],u=i._plots[c],f=[],d=0;d<l.length;d++){var p=l[d],g=p[0].trace;g.xaxis+g.yaxis===c&&((-1!==e.indexOf(g.index)||g.carpet)&&(s&&s[0].trace.xaxis+s[0].trace.yaxis===c&&-1!==["tonextx","tonexty","tonext"].indexOf(g.fill)&&-1===f.indexOf(s)&&f.push(s),f.push(p)),s=p)}h(t,u,f,r,n)}},r.clean=function(t,e,r,n){var a,i,o,l=n._plots||{},s=e._plots||{},u=n._subplots||{};if(n._hasOnlyLargeSploms&&!e._hasOnlyLargeSploms)for(o in l)(a=l[o]).plotgroup&&a.plotgroup.remove();var f=n._has&&n._has("gl"),d=e._has&&e._has("gl");if(f&&!d)for(o in l)(a=l[o])._scene&&a._scene.destroy();if(u.xaxis&&u.yaxis){var p=c.listIds({_fullLayout:n});for(i=0;i<p.length;i++){var h=p[i];e[c.id2name(h)]||n._infolayer.selectAll(".g-"+h+"title").remove()}}var g=n._has&&n._has("cartesian"),y=e._has&&e._has("cartesian");if(g&&!y)v(n._cartesianlayer.selectAll(".subplot"),n),n._defs.selectAll(".axesclip").remove(),delete n._axisConstraintGroups,delete n._axisMatchGroups;else if(u.cartesian)for(i=0;i<u.cartesian.length;i++){var x=u.cartesian[i];if(!s[x]){var b="."+x+",."+x+"-x,."+x+"-y";n._cartesianlayer.selectAll(b).remove(),m(x,n)}}},r.drawFramework=function(t){var e=t._fullLayout,r=function(t){var e,r,n,a,i,o,l=t._fullLayout,s=l._subplots.cartesian,c=s.length,u=[],f=[];for(e=0;e<c;e++){n=s[e],a=l._plots[n],i=a.xaxis,o=a.yaxis;var d=i._mainAxis,p=o._mainAxis,h=d._id+p._id,g=l._plots[h];a.overlays=[],h!==n&&g?(a.mainplot=h,a.mainplotinfo=g,f.push(n)):(a.mainplot=void 0,a.mainplotinfo=void 0,u.push(n))}for(e=0;e<f.length;e++)n=f[e],(a=l._plots[n]).mainplotinfo.overlays.push(a);var v=u.concat(f),m=new Array(c);for(e=0;e<c;e++){n=v[e],a=l._plots[n],i=a.xaxis,o=a.yaxis;var y=[n,i.layer,o.layer,i.overlaying||"",o.overlaying||""];for(r=0;r<a.overlays.length;r++)y.push(a.overlays[r].id);m[e]=y}return m}(t),a=e._cartesianlayer.selectAll(".subplot").data(r,String);a.enter().append("g").attr("class",(function(t){return"subplot "+t[0]})),a.order(),a.exit().call(v,e),a.each((function(r){var a=r[0],i=e._plots[a];i.plotgroup=n.select(this),g(t,i),i.draglayer=d(e._draggers,"g",a)}))},r.rangePlot=function(t,e,r){g(t,e),h(t,e,r),o.style(t)},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:f.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})}))},r.updateFx=t("./graph_interact").updateFx},{"../../components/drawing":127,"../../constants/xmlns_namespaces":213,"../../lib":233,"../../registry":326,"../get_data":309,"../plots":313,"./attributes":277,"./axis_ids":282,"./constants":285,"./graph_interact":288,"./layout_attributes":293,"./layout_defaults":294,"./transition_axes":303,d3:21}],293:[function(t,e,r){"use strict";var n=t("../font_attributes"),a=t("../../components/color/attributes"),i=t("../../components/drawing/attributes").dash,o=t("../../lib/extend").extendFlat,l=t("../../plot_api/plot_template").templatedArray,s=(t("../../constants/docs").FORMAT_LINK,t("../../constants/docs").DATE_FORMAT_LINK,t("../../constants/numerical").ONEDAY),c=t("./constants"),u=c.HOUR_PATTERN,f=c.WEEKDAY_PATTERN;e.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:a.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:n({editType:"ticks"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},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"],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"},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks"},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc"},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"},minexponent:{valType:"number",dflt:3,min:0,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":104,"../../components/drawing/attributes":126,"../../constants/docs":209,"../../constants/numerical":212,"../../lib/extend":227,"../../plot_api/plot_template":268,"../font_attributes":307,"./constants":285}],294:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),i=t("../../components/fx/helpers").isUnifiedHover,o=t("../../components/fx/hovermode_defaults"),l=t("../../plot_api/plot_template"),s=t("../layout_attributes"),c=t("./layout_attributes"),u=t("./type_defaults"),f=t("./axis_defaults"),d=t("./constraints"),p=t("./position_defaults"),h=t("./axis_ids"),g=h.id2name,v=h.name2id,m=t("./constants").AX_ID_PATTERN,y=t("../../registry"),x=y.traceIs,b=y.getComponentMethod;function _(t,e,r){Array.isArray(t[e])?t[e].push(r):t[e]=[r]}e.exports=function(t,e,r){var y,w,T=e.autotypenumbers,k={},M={},A={},L={},S={},C={},O={},D={},z={},P={};for(y=0;y<r.length;y++){var E=r[y];if(x(E,"cartesian")||x(E,"gl2d")){var I,R;if(E.xaxis)I=g(E.xaxis),_(k,I,E);else if(E.xaxes)for(w=0;w<E.xaxes.length;w++)_(k,g(E.xaxes[w]),E);if(E.yaxis)R=g(E.yaxis),_(k,R,E);else if(E.yaxes)for(w=0;w<E.yaxes.length;w++)_(k,g(E.yaxes[w]),E);if("funnel"===E.type?"h"===E.orientation?(I&&(M[I]=!0),R&&(O[R]=!0)):R&&(A[R]=!0):"image"===E.type?(R&&(D[R]=!0),I&&(D[I]=!0)):(R&&(S[R]=!0,C[R]=!0),x(E,"carpet")&&("carpet"!==E.type||E._cheater)||I&&(L[I]=!0)),"carpet"===E.type&&E._cheater&&I&&(M[I]=!0),x(E,"2dMap")&&(z[I]=!0,z[R]=!0),x(E,"oriented"))P["h"===E.orientation?R:I]=!0}}var F=e._subplots,N=F.xaxis,B=F.yaxis,H=n.simpleMap(N,g),j=n.simpleMap(B,g),U=H.concat(j),V=a.background;N.length&&B.length&&(V=n.coerce(t,e,s,"plot_bgcolor"));var q,G,Z,Y,X,W=a.combine(V,e.paper_bgcolor);function Q(){var t=k[q]||[];X._traceIndices=t.map((function(t){return t._expandedIndex})),X._annIndices=[],X._shapeIndices=[],X._imgIndices=[],X._subplotsWith=[],X._counterAxes=[],X._name=X._attr=q,X._id=G}function J(t,e){return n.coerce(Y,X,c,t,e)}function $(t,e){return n.coerce2(Y,X,c,t,e)}function K(t){return"x"===t?B:N}function tt(e,r){for(var n="x"===e?H:j,a=[],i=0;i<n.length;i++){var o=n[i];o===r||(t[o]||{}).overlaying||a.push(v(o))}return a}var et={x:K("x"),y:K("y")},rt=et.x.concat(et.y),nt={},at=[];function it(){var t=Y.matches;m.test(t)&&-1===rt.indexOf(t)&&(nt[t]=Y.type,at=Object.keys(nt))}var ot=o(t,e,r),lt=i(ot);for(y=0;y<U.length;y++){q=U[y],G=v(q),Z=q.charAt(0),n.isPlainObject(t[q])||(t[q]={}),Y=t[q],X=l.newContainer(e,q,Z+"axis"),Q();var st="x"===Z&&!L[q]&&M[q]||"y"===Z&&!S[q]&&A[q],ct="y"===Z&&(!C[q]&&O[q]||D[q]),ut={letter:Z,font:e.font,outerTicks:z[q],showGrid:!P[q],data:k[q]||[],bgColor:W,calendar:e.calendar,automargin:!0,visibleDflt:st,reverseDflt:ct,autotypenumbersDflt:T,splomStash:((e._splomAxes||{})[Z]||{})[G]};J("uirevision",e.uirevision),u(Y,X,J,ut),f(Y,X,J,ut,e);var ft=lt&&Z===ot.charAt(0),dt=$("spikecolor",lt?X.color:void 0),pt=$("spikethickness",lt?1.5:void 0),ht=$("spikedash",lt?"dot":void 0),gt=$("spikemode",lt?"across":void 0),vt=$("spikesnap",lt?"hovered data":void 0);J("showspikes",!!(ft||dt||pt||ht||gt||vt))||(delete X.spikecolor,delete X.spikethickness,delete X.spikedash,delete X.spikemode,delete X.spikesnap),p(Y,X,J,{letter:Z,counterAxes:et[Z],overlayableAxes:tt(Z,q),grid:e.grid}),J("title.standoff"),it(),X._input=Y}for(y=0;y<at.length;){G=at[y++],Z=(q=g(G)).charAt(0),n.isPlainObject(t[q])||(t[q]={}),Y=t[q],X=l.newContainer(e,q,Z+"axis"),Q();var mt={letter:Z,font:e.font,outerTicks:z[q],showGrid:!P[q],data:[],bgColor:W,calendar:e.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,autotypenumbersDflt:T,splomStash:((e._splomAxes||{})[Z]||{})[G]};J("uirevision",e.uirevision),X.type=nt[G]||"linear",f(Y,X,J,mt,e),p(Y,X,J,{letter:Z,counterAxes:et[Z],overlayableAxes:tt(Z,q),grid:e.grid}),J("fixedrange"),it(),X._input=Y}var yt=b("rangeslider","handleDefaults"),xt=b("rangeselector","handleDefaults");for(y=0;y<H.length;y++)q=H[y],Y=t[q],X=e[q],yt(t,e,q),"date"===X.type&&xt(Y,X,e,j,X.calendar),J("fixedrange");for(y=0;y<j.length;y++){q=j[y],Y=t[q],X=e[q];var bt=e[g(X.anchor)];J("fixedrange",b("rangeslider","isVisible")(bt))}d.handleDefaults(t,e,{axIds:rt.concat(at).sort(h.idSort),axHasImage:D})}},{"../../components/color":105,"../../components/fx/helpers":141,"../../components/fx/hovermode_defaults":144,"../../lib":233,"../../plot_api/plot_template":268,"../../registry":326,"../layout_attributes":311,"./axis_defaults":281,"./axis_ids":282,"./constants":285,"./constraints":286,"./layout_attributes":293,"./position_defaults":296,"./type_defaults":304}],295:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,a=t("../../components/color/attributes").lightFraction,i=t("../../lib");e.exports=function(t,e,r,o){var l=(o=o||{}).dfltColor;function s(r,n){return i.coerce2(t,e,o.attributes,r,n)}var c=s("linecolor",l),u=s("linewidth");r("showline",o.showLine||!!c||!!u)||(delete e.linecolor,delete e.linewidth);var f=s("gridcolor",n(l,o.bgColor,o.blend||a).toRgbString()),d=s("gridwidth");if(r("showgrid",o.showGrid||!!f||!!d)||(delete e.gridcolor,delete e.gridwidth),!o.noZeroLine){var p=s("zerolinecolor",l),h=s("zerolinewidth");r("zeroline",o.showGrid||!!p||!!h)||(delete e.zerolinecolor,delete e.zerolinewidth)}}},{"../../components/color/attributes":104,"../../lib":233,tinycolor2:88}],296:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib");e.exports=function(t,e,r,i){var o,l,s,c,u=i.counterAxes||[],f=i.overlayableAxes||[],d=i.letter,p=i.grid;p&&(l=p._domains[d][p._axisMap[e._id]],o=p._anchors[e._id],l&&(s=p[d+"side"].split(" ")[0],c=p.domain[d]["right"===s||"top"===s?1:0])),l=l||[0,1],o=o||(n(t.position)?"free":u[0]||"free"),s=s||("x"===d?"bottom":"left"),c=c||0,"free"===a.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(u),dflt:o}},"anchor")&&r("position",c),a.coerce(t,e,{side:{valType:"enumerated",values:"x"===d?["bottom","top"]:["left","right"],dflt:s}},"side");var h=!1;if(f.length&&(h=a.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(f),dflt:!1}},"overlaying")),!h){var g=r("domain",l);g[0]>g[1]-1/4096&&(e.domain=l),a.noneOrAll(t.domain,e.domain,l)}return r("layer"),e}},{"../../lib":233,"fast-isnumeric":23}],297:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)],t.setScale()}},{"../../constants/alignment":207}],298:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/drawing").dashStyle,o=t("../../components/color"),l=t("../../components/fx"),s=t("../../components/fx/helpers").makeEventData,c=t("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,d=c.drawMode,p=c.openMode,h=c.selectMode,g=t("../../components/shapes/draw_newshape/display_outlines"),v=t("../../components/shapes/draw_newshape/helpers").handleEllipse,m=t("../../components/shapes/draw_newshape/newshapes"),y=t("../../lib"),x=t("../../lib/polygon"),b=t("../../lib/throttle"),_=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),T=t("../../plot_api/subroutines").redrawReglTraces,k=t("./constants"),M=k.MINSELECT,A=x.filter,L=x.tester,S=t("./handle_outline").clearSelect,C=t("./helpers"),O=C.p2r,D=C.axValue,z=C.getTransform;function P(t,e,r,n,a,i,o){var l,s,c,u,f,d,h,v,m,y=e._hoverdata,x=e._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){F(t,e,i);var _=function(t,e){var r,n,a=t[0],i=-1,o=[];for(n=0;n<e.length;n++)if(r=e[n],a.fullData._expandedIndex===r.cd[0].trace._expandedIndex){if(!0===a.hoverOnBox)break;void 0!==a.pointNumber?i=a.pointNumber:void 0!==a.binNumber&&(i=a.binNumber,o=a.pointNumbers);break}return{pointNumber:i,pointNumbers:o,searchInfo:r}}(y,l=B(e,r,n,a));if(_.pointNumbers.length>0?function(t,e){var r,n,a,i=[];for(a=0;a<t.length;a++)(r=t[a]).cd[0].trace.selectedpoints&&r.cd[0].trace.selectedpoints.length>0&&i.push(r);if(1===i.length&&i[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(a=0;a<e.pointNumbers.length;a++)if(n.selectedpoints.indexOf(e.pointNumbers[a])<0)return!1;return!0}return!1}(l,_):function(t){var e,r,n,a=0;for(n=0;n<t.length;n++)if(e=t[n],(r=e.cd[0].trace).selectedpoints){if(r.selectedpoints.length>1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=H(_))){for(o&&o.remove(),m=0;m<l.length;m++)(s=l[m])._module.selectPoints(s,!1);j(e,l),N(i),x&&e.emit("plotly_deselect",null)}else{for(h=t.shiftKey&&(void 0!==d?d:H(_)),c=function(t,e,r){return{pointNumber:t,searchInfo:e,subtract:r}}(_.pointNumber,_.searchInfo,h),u=R(i.selectionDefs.concat([c])),m=0;m<l.length;m++)if(f=U(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(e,l,v={points:b}),c&&i&&i.selectionDefs.push(c),o){var T=i.mergedPolygons,k=p(i.dragmode);g(V(T,k),o,i)}x&&e.emit("plotly_selected",v)}}}function E(t){return"pointNumber"in t&&"searchInfo"in t}function I(t){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(e,r,n,a){var i=t.searchInfo.cd[0].trace._expandedIndex;return a.cd[0].trace._expandedIndex===i&&n===t.pointNumber},isRect:!1,degenerate:!1,subtract:t.subtract}}function R(t){for(var e=[],r=E(t[0])?0:t[0][0][0],n=r,a=E(t[0])?0:t[0][0][1],i=a,o=0;o<t.length;o++)if(E(t[o]))e.push(I(t[o]));else{var l=x.tester(t[o]);l.subtract=t[o].subtract,e.push(l),r=Math.min(r,l.xmin),n=Math.max(n,l.xmax),a=Math.min(a,l.ymin),i=Math.max(i,l.ymax)}return{xmin:r,xmax:n,ymin:a,ymax:i,pts:[],contains:function(t,r,n,a){for(var i=!1,o=0;o<e.length;o++)e[o].contains(t,r,n,a)&&(i=!1===e[o].subtract);return i},isRect:!1,degenerate:!1}}function F(t,e,r){e._fullLayout._drawing=!1;var n=e._fullLayout,a=r.plotinfo,i=r.dragmode,o=n._lastSelectedSubplot&&n._lastSelectedSubplot===a.id,l=(t.shiftKey||t.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(e),n._lastSelectedSubplot=a.id)}function N(t){var e=t.dragmode,r=t.plotinfo,n=t.gd;if(n._fullLayout._activeShapeIndex>=0&&n._fullLayout._deactivateShape(n),d(e)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,t);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function B(t,e,r,n){var a,i,o,l=[],s=e.map((function(t){return t._id})),c=r.map((function(t){return t._id}));for(o=0;o<t.calcdata.length;o++)if(!0===(i=(a=t.calcdata[o])[0].trace).visible&&i._module&&i._module.selectPoints)if(!n||i.subplot!==n&&i.geo!==n)if("splom"===i.type&&i._xaxes[s[0]]&&i._yaxes[c[0]]){var u=d(i._module,a,e[0],r[0]);u.scene=t._fullLayout._splomScenes[i.uid],l.push(u)}else if("sankey"===i.type){var f=d(i._module,a,e[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,_(t,i.xaxis),_(t,i.yaxis)))}else l.push(d(i._module,a,e[0],r[0]));return l;function d(t,e,r,n){return{_module:t,cd:e,xaxis:r,yaxis:n}}}function H(t){var e=t.searchInfo.cd[0].trace,r=t.pointNumber,n=t.pointNumbers,a=n.length>0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function j(t,e,r){var n,i,o,l;for(n=0;n<e.length;n++){var s=e[n].cd[0].trace._fullInput,c=t._fullLayout._tracePreGUI[s.uid]||{};void 0===c.selectedpoints&&(c.selectedpoints=s._input.selectedpoints||null)}if(r){var u=r.points||[];for(n=0;n<e.length;n++)(l=e[n].cd[0].trace)._input.selectedpoints=l._fullInput.selectedpoints=[],l._fullInput!==l&&(l.selectedpoints=[]);for(n=0;n<u.length;n++){var f=u[n],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<e.length;n++)delete(l=e[n].cd[0].trace).selectedpoints,delete l._input.selectedpoints,l._fullInput!==l&&delete l._fullInput.selectedpoints;var h=!1;for(n=0;n<e.length;n++){l=(o=(i=e[n]).cd)[0].trace,a.traceIs(l,"regl")&&(h=!0);var g=i._module,v=g.styleOnSelect||g.style;v&&(v(t,o,o[0].node3),o[0].nodeRangePlot3&&v(t,o,o[0].nodeRangePlot3))}h&&(w(t),T(t))}function U(t,e){if(Array.isArray(t))for(var r=e.cd,n=e.cd[0].trace,a=0;a<t.length;a++)t[a]=s(t[a],n,r);return t}function V(t,e){for(var r=[],n=0;n<t.length;n++){r[n]=[];for(var a=0;a<t[n].length;a++){r[n][a]=[],r[n][a][0]=a?"L":"M";for(var i=0;i<t[n][a].length;i++)r[n][a].push(t[n][a][i])}e||r[n].push(["Z",r[n][0][1],r[n][0][2]])}return r}e.exports={prepSelect:function(t,e,r,a,s){var c=u(s),m=f(s),x=p(s),_=d(s),w=h(s),T="drawcircle"===s,S="drawline"===s||T,C=a.gd,E=C._fullLayout,I=E._zoomlayer,H=a.element.getBoundingClientRect(),q=a.plotinfo,G=z(q),Z=e-H.left,Y=r-H.top;E._calcInverseTransform(C);var X=y.apply3DTransform(E._invTransform)(Z,Y);Z=X[0],Y=X[1];var W,Q,J,$,K,tt,et,rt=E._invScaleX,nt=E._invScaleY,at=Z,it=Y,ot="M"+Z+","+Y,lt=a.xaxes[0]._length,st=a.yaxes[0]._length,ct=a.xaxes.concat(a.yaxes),ut=t.altKey&&!(d(s)&&x);F(t,C,a),c&&(W=A([[Z,Y]],k.BENDPX));var ft=I.selectAll("path.select-outline-"+q.id).data(_?[0]:[1,2]),dt=E.newshape;ft.enter().append("path").attr("class",(function(t){return"select-outline select-outline-"+t+" select-outline-"+q.id})).style(_?{opacity:dt.opacity/2,fill:x?void 0:dt.fillcolor,stroke:dt.line.color,"stroke-dasharray":i(dt.line.dash,dt.line.width),"stroke-width":dt.line.width+"px"}:{}).attr("fill-rule",dt.fillrule).classed("cursor-move",!!_).attr("transform",G).attr("d",ot+"Z");var pt,ht=I.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform",G).attr("d","M0,0Z"),gt=E._uid+k.SELECTID,vt=[],mt=B(C,a.xaxes,a.yaxes,a.subplot);function yt(t,e){return t-e}pt=q.fillRangeItems?q.fillRangeItems:m?function(t,e){var r=t.range={};for(K=0;K<ct.length;K++){var n=ct[K],a=n._id.charAt(0);r[n._id]=[O(n,e[a+"min"]),O(n,e[a+"max"])].sort(yt)}}:function(t,e,r){var n=t.lassoPoints={};for(K=0;K<ct.length;K++){var a=ct[K];n[a._id]=r.filtered.map(D(a))}},a.moveFn=function(t,e){at=Math.max(0,Math.min(lt,rt*t+Z)),it=Math.max(0,Math.min(st,nt*e+Y));var r=Math.abs(at-Z),i=Math.abs(it-Y);if(m){var o,l,s;if(w){var u=E.selectdirection;switch(o="any"===u?i<Math.min(.6*r,M)?"h":r<Math.min(.6*i,M)?"v":"d":u){case"h":l=T?st/2:0,s=st;break;case"v":l=T?lt/2:0,s=lt}}if(_)switch(E.newshape.drawdirection){case"vertical":o="h",l=T?st/2:0,s=st;break;case"horizontal":o="v",l=T?lt/2:0,s=lt;break;case"ortho":r<i?(o="h",l=Y,s=it):(o="v",l=Z,s=at);break;default:o="d"}"h"===o?(($=S?v(T,[at,l],[at,s]):[[Z,l],[Z,s],[at,s],[at,l]]).xmin=S?at:Math.min(Z,at),$.xmax=S?at:Math.max(Z,at),$.ymin=Math.min(l,s),$.ymax=Math.max(l,s),ht.attr("d","M"+$.xmin+","+(Y-M)+"h-4v"+2*M+"h4ZM"+($.xmax-1)+","+(Y-M)+"h4v"+2*M+"h-4Z")):"v"===o?(($=S?v(T,[l,it],[s,it]):[[l,Y],[l,it],[s,it],[s,Y]]).xmin=Math.min(l,s),$.xmax=Math.max(l,s),$.ymin=S?it:Math.min(Y,it),$.ymax=S?it:Math.max(Y,it),ht.attr("d","M"+(Z-M)+","+$.ymin+"v-4h"+2*M+"v4ZM"+(Z-M)+","+($.ymax-1)+"v4h"+2*M+"v-4Z")):"d"===o&&(($=S?v(T,[Z,Y],[at,it]):[[Z,Y],[Z,it],[at,it],[at,Y]]).xmin=Math.min(Z,at),$.xmax=Math.max(Z,at),$.ymin=Math.min(Y,it),$.ymax=Math.max(Y,it),ht.attr("d","M0,0Z"))}else c&&(W.addPt([at,it]),$=W.filtered);a.selectionDefs&&a.selectionDefs.length?(J=function(t,e,r){if(r)return n.difference({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions;return n.union({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions}(a.mergedPolygons,$,ut),$.subtract=ut,Q=R(a.selectionDefs.concat([$]))):(J=[$],Q=L($)),g(V(J,x),ft,a),w&&b.throttle(gt,k.SELECTDELAY,(function(){var t;vt=[];var e,r=[];for(K=0;K<mt.length;K++)if(e=(tt=mt[K])._module.selectPoints(tt,Q),r.push(e),t=U(e,tt),vt.length)for(var n=0;n<t.length;n++)vt.push(t[n]);else vt=t;j(C,mt,et={points:vt}),pt(et,$,W),a.gd.emit("plotly_selecting",et)}))},a.clickFn=function(t,e){if(ht.remove(),C._fullLayout._activeShapeIndex>=0)C._fullLayout._deactivateShape(C);else if(!_){var r=E.clickmode;b.done(gt).then((function(){if(b.clear(gt),2===t){for(ft.remove(),K=0;K<mt.length;K++)(tt=mt[K])._module.selectPoints(tt,!1);j(C,mt),N(a),C.emit("plotly_deselect",null)}else r.indexOf("select")>-1&&P(e,C,a.xaxes,a.yaxes,a.subplot,a,ft),"event"===r&&C.emit("plotly_selected",void 0);l.click(C,e)})).catch(y.error)}},a.doneFn=function(){ht.remove(),b.done(gt).then((function(){b.clear(gt),a.gd.emit("plotly_selected",et),$&&a.selectionDefs&&($.subtract=ut,a.selectionDefs.push($),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,J)),a.doneFnCompleted&&a.doneFnCompleted(vt)})).catch(y.error),_&&N(a)}},clearSelect:S,clearSelectionsCache:N,selectOnClick:P}},{"../../components/color":105,"../../components/dragelement/helpers":123,"../../components/drawing":127,"../../components/fx":145,"../../components/fx/helpers":141,"../../components/shapes/draw_newshape/display_outlines":190,"../../components/shapes/draw_newshape/helpers":191,"../../components/shapes/draw_newshape/newshapes":192,"../../lib":233,"../../lib/clear_gl_canvases":221,"../../lib/polygon":245,"../../lib/throttle":256,"../../plot_api/subroutines":269,"../../registry":326,"./axis_ids":282,"./constants":285,"./handle_outline":289,"./helpers":290,polybooljs:79}],299:[function(t,e,r){"use strict";var n=t("d3"),a=t("d3-time-format").utcFormat,i=t("fast-isnumeric"),o=t("../../lib"),l=o.cleanNumber,s=o.ms2DateTime,c=o.dateTime2ms,u=o.ensureNumber,f=o.isArrayOrTypedArray,d=t("../../constants/numerical"),p=d.FP_SAFE,h=d.BADNUM,g=d.LOG_CLIP,v=d.ONEWEEK,m=d.ONEDAY,y=d.ONEHOUR,x=d.ONEMIN,b=d.ONESEC,_=t("./axis_ids"),w=t("./constants"),T=w.HOUR_PATTERN,k=w.WEEKDAY_PATTERN;function M(t){return Math.pow(10,t)}function A(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",d=r.charAt(0);function L(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-2*g*Math.abs(n-a))}return h}function S(e,r,n,a){if((a||{}).msUTC&&i(e))return+e;var l=c(e,n||t.calendar);if(l===h){if(!i(e))return h;e=+e;var s=Math.floor(10*o.mod(e+.05,1)),u=Math.round(e-s/10);l=c(new Date(u))+s/10}return l}function C(e,r,n){return s(e,r,n||t.calendar)}function O(e){return t._categories[Math.round(e)]}function D(e){if(A(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return h}function z(e){if(t._categoriesMap)return t._categoriesMap[e]}function P(t){var e=z(t);return void 0!==e?e:i(t)?+t:void 0}function E(t){return i(t)?+t:z(t)}function I(t,e,r){return n.round(r+e*t,2)}function R(t,e,r){return(t-r)/e}var F=function(e){return i(e)?I(e,t._m,t._b):h},N=function(e){return R(e,t._m,t._b)};if(t.rangebreaks){var B="y"===d;F=function(e){if(!i(e))return h;var r=t._rangebreaks.length;if(!r)return I(e,t._m,t._b);var n=B;t.range[0]>t.range[1]&&(n=!n);for(var a=n?-1:1,o=a*e,l=0,s=0;s<r;s++){var c=a*t._rangebreaks[s].min,u=a*t._rangebreaks[s].max;if(o<c)break;if(!(o>u)){l=o<(c+u)/2?s:s+1;break}l=s+1}var f=t._B[l]||0;return isFinite(f)?I(e,t._m2,f):0},N=function(e){var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);for(var n=0,a=0;a<r&&!(e<t._rangebreaks[a].pmin);a++)e>t._rangebreaks[a].pmax&&(n=a+1);return R(e,t._m2,t._B[n])}}t.c2l="log"===t.type?L:u,t.l2c="log"===t.type?M:u,t.l2p=F,t.p2l=N,t.c2p="log"===t.type?function(t,e){return F(L(t,e))}:F,t.p2c="log"===t.type?function(t){return M(N(t))}:N,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=N,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return L(l(t),e)},t.r2d=t.r2c=function(t){return M(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=u,t.c2r=L,t.l2d=M,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return M(N(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=N,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=S,t.c2d=t.c2r=t.l2d=t.l2r=C,t.d2p=t.r2p=function(e,r,n){return t.l2p(S(e,0,n))},t.p2d=t.p2r=function(t,e,r){return C(N(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,h,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=D,t.r2d=t.c2d=t.l2d=O,t.d2r=t.d2l_noadd=P,t.r2c=function(e){var r=E(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=E,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return O(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=O,t.d2r=t.d2l_noadd=P,t.r2c=function(e){var r=P(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=z,t.l2r=t.c2r=u,t.r2l=P,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return O(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:u(t)},t.setupMultiCategory=function(n){var a,i,l=t._traceIndices,s=t._matchGroup;if(s&&0===t._categories.length)for(var c in s)if(c!==r){var u=e[_.id2name(c)];l=l.concat(u._traceIndices)}var p=[[0,{}],[0,{}]],h=[];for(a=0;a<l.length;a++){var g=n[l[a]];if(d in g){var v=g[d],m=g._length||o.minRowLength(v);if(f(v[0])&&f(v[1]))for(i=0;i<m;i++){var y=v[0][i],x=v[1][i];A(y)&&A(x)&&(h.push([y,x]),y in p[0][1]||(p[0][1][y]=p[0][0]++),x in p[1][1]||(p[1][1][x]=p[1][0]++))}}}for(h.sort((function(t,e){var r=p[0][1],n=r[t[0]]-r[e[0]];if(n)return n;var a=p[1][1];return a[t[1]]-a[e[1]]})),a=0;a<h.length;a++)D(h[a])}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e,r){r||(r={}),e||(e="range");var n,a,l=o.nestedProperty(t,e).get();if(a=(a="date"===t.type?o.dfltRange(t.calendar):"y"===d?w.DFLTRANGEY:r.dfltRange||w.DFLTRANGEX).slice(),"tozero"!==t.rangemode&&"nonnegative"!==t.rangemode||(a[0]=0),l&&2===l.length)for("date"!==t.type||t.autorange||(l[0]=o.cleanDate(l[0],h,t.calendar),l[1]=o.cleanDate(l[1],h,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!o.isDateTime(l[n],t.calendar)){t[e]=a;break}if(t.r2l(l[0])===t.r2l(l[1])){var s=o.constrain(t.r2l(l[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);l[0]=t.l2r(s-1e3),l[1]=t.l2r(s+1e3);break}}else{if(!i(l[n])){if(!i(l[1-n])){t[e]=a;break}l[n]=l[1-n]*(n?10:.1)}if(l[n]<-p?l[n]=-p:l[n]>p&&(l[n]=p),l[0]===l[1]){var c=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=c,l[1]+=c}}else o.nestedProperty(t,e).set(a)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=_.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var l,s,c=t.r2l(t[i][0],o),u=t.r2l(t[i][1],o),f="y"===d;if((f?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(c,u),Math.max(c,u)),t._rangebreaks.length)){for(l=0;l<t._rangebreaks.length;l++)s=t._rangebreaks[l],t._lBreaks+=Math.abs(s.max-s.min);var p=f;c>u&&(p=!p),p&&t._rangebreaks.reverse();var h=p?-1:1;for(t._m2=h*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(f?u:c)),l=0;l<t._rangebreaks.length;l++)s=t._rangebreaks[l],t._B.push(t._B[t._B.length-1]-h*t._m2*(s.max-s.min));for(l=0;l<t._rangebreaks.length;l++)(s=t._rangebreaks[l]).pmin=F(s.min),s.pmax=F(s.max)}if(!isFinite(t._m)||!isFinite(t._b)||t._length<0)throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.maskBreaks=function(e){for(var r,n,a,i,s,c=t.rangebreaks||[],u=0;u<c.length;u++){var f=c[u];if(f.enabled)if(f.bounds){var d=f.pattern;switch(n=(r=o.simpleMap(f.bounds,d?l:t.d2c))[0],a=r[1],d){case k:i=(s=new Date(e)).getUTCDay(),n>a&&(a+=7,i<n&&(i+=7));break;case T:i=(s=new Date(e)).getUTCHours()+(s.getUTCMinutes()/60+s.getUTCSeconds()/3600+s.getUTCMilliseconds()/36e5),n>a&&(a+=24,i<n&&(i+=24));break;case"":i=e}if(i>=n&&i<a)return h}else for(var p=o.simpleMap(f.values,t.d2c).sort(o.sorterAsc),g=0;g<p.length;g++)if(a=(n=p[g])+f.dvalue,e>=n&&e<a)return h}return e},t.locateBreaks=function(e,r){var n,a,i,s,c=[];if(!t.rangebreaks)return c;var u=t.rangebreaks.slice().sort((function(t,e){return t.pattern===k&&e.pattern===T?-1:e.pattern===k&&t.pattern===T?1:0})),f=function(t,n){if((t=o.constrain(t,e,r))!==(n=o.constrain(n,e,r))){for(var a=!0,i=0;i<c.length;i++){var l=c[i];t<l.max&&n>=l.min&&(t<l.min&&(l.min=t),n>l.max&&(l.max=n),a=!1)}a&&c.push({min:t,max:n})}};for(n=0;n<u.length;n++){var d=u[n];if(d.enabled)if(d.bounds){var p=e,h=r;d.pattern&&(p=Math.floor(p)),i=(a=o.simpleMap(d.bounds,d.pattern?l:t.r2l))[0],s=a[1];var g,_,w=new Date(p);switch(d.pattern){case k:_=v,g=(s-i+(s<i?7:0))*m,p+=i*m-(w.getUTCDay()*m+w.getUTCHours()*y+w.getUTCMinutes()*x+w.getUTCSeconds()*b+w.getUTCMilliseconds());break;case T:_=m,g=(s-i+(s<i?24:0))*y,p+=i*y-(w.getUTCHours()*y+w.getUTCMinutes()*x+w.getUTCSeconds()*b+w.getUTCMilliseconds());break;default:p=Math.min(a[0],a[1]),g=_=(h=Math.max(a[0],a[1]))-p}for(var M=p;M<h;M+=_)f(M,M+g)}else for(var A=o.simpleMap(d.values,t.d2c),L=0;L<A.length;L++)f(i=A[L],s=i+d.dvalue)}return c.sort((function(t,e){return t.min-e.min})),c},t.makeCalcdata=function(e,r,n){var a,i,l,s,c=t.type,u="date"===c&&e[r+"calendar"];if(r in e){if(a=e[r],s=e._length||o.minRowLength(a),o.isTypedArray(a)&&("linear"===c||"log"===c)){if(s===a.length)return a;if(a.subarray)return a.subarray(0,s)}if("multicategory"===c)return function(t,e){for(var r=new Array(e),n=0;n<e;n++){var a=(t[0]||[])[n],i=(t[1]||[])[n];r[n]=z([a,i])}return r}(a,s);for(i=new Array(s),l=0;l<s;l++)i[l]=t.d2c(a[l],0,u,n)}else{var f=r+"0"in e?t.d2c(e[r+"0"],0,u):0,d=e["d"+r]?Number(e["d"+r]):1;for(a=e[{x:"y",y:"x"}[r]],s=e._length||a.length,i=new Array(s),l=0;l<s;l++)i[l]=f+l*d}if(t.rangebreaks)for(l=0;l<s;l++)i[l]=t.maskBreaks(i[l]);return i},t.isValidRange=function(e){return Array.isArray(e)&&2===e.length&&i(t.r2l(e[0]))&&i(t.r2l(e[1]))},t.isPtWithinRange=function(e,r){var n=t.c2l(e[d],null,r),a=t.r2l(t.range[0]),i=t.r2l(t.range[1]);return a<i?a<=n&&n<=i:i<=n&&n<=a},t._emptyCategories=function(){t._categories=[],t._categoriesMap={}},t.clearCalc=function(){var r=t._matchGroup;if(r){var n=null,a=null;for(var i in r){var o=e[_.id2name(i)];if(o._categories){n=o._categories,a=o._categoriesMap;break}}n&&a?(t._categories=n,t._categoriesMap=a):t._emptyCategories()}else t._emptyCategories();if(t._initialCategories)for(var l=0;l<t._initialCategories.length;l++)D(t._initialCategories[l])},t.sortByInitialCategories=function(){var n=[];if(t._emptyCategories(),t._initialCategories)for(var a=0;a<t._initialCategories.length;a++)D(t._initialCategories[a]);n=n.concat(t._traceIndices);var i=t._matchGroup;for(var o in i)if(r!==o){var l=e[_.id2name(o)];l._categories=t._categories,l._categoriesMap=t._categoriesMap,n=n.concat(l._traceIndices)}return n};var H=e._d3locale;"date"===t.type&&(t._dateFormat=H?H.timeFormat:a,t._extraFormat=e._extraFormat),t._separators=e.separators,t._numFormat=H?H.numberFormat:n.format,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":212,"../../lib":233,"./axis_ids":282,"./constants":285,d3:21,"d3-time-format":19,"fast-isnumeric":23}],300:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color").contrast,i=t("./layout_attributes"),o=t("../array_container_defaults");function l(t){var e=["showexponent","showtickprefix","showticksuffix"].filter((function(e){return void 0!==t[e]}));if(e.every((function(r){return t[r]===t[e[0]]}))||1===e.length)return t[e[0]]}function s(t,e){function r(r,a){return n.coerce(t,e,i.tickformatstops,r,a)}r("enabled")&&(r("dtickrange"),r("value"))}e.exports=function(t,e,r,c,u,f){f&&1!==f.pass||function(t,e,r,n,a){var i=l(t);r("tickprefix")&&r("showtickprefix",i);r("ticksuffix",a.tickSuffixDflt)&&r("showticksuffix",i)}(t,0,r,0,u),f&&2!==f.pass||function(t,e,r,c,u){var f=l(t);r("tickprefix")&&r("showtickprefix",f);r("ticksuffix",u.tickSuffixDflt)&&r("showticksuffix",f);if(r("showticklabels")){var d=u.font||{},p=e.color,h=-1!==(e.ticklabelposition||"").indexOf("inside")?a(u.bgColor):p&&p!==i.color.dflt?p:d.color;if(n.coerceFont(r,"tickfont",{family:d.family,size:d.size,color:h}),r("tickangle"),"category"!==c){var g=r("tickformat");o(t,e,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:s}),e.tickformatstops.length||delete e.tickformatstops,g||"date"===c||(r("showexponent",f),r("exponentformat"),r("minexponent"),r("separatethousands"))}}}(t,e,r,c,u)}},{"../../components/color":105,"../../lib":233,"../array_container_defaults":274,"./layout_attributes":293}],301:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,i){var o=n.coerce2(t,e,a,"ticklen"),l=n.coerce2(t,e,a,"tickwidth"),s=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",i.outerTicks||o||l||s?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":233,"./layout_attributes":293}],302:[function(t,e,r){"use strict";var n=t("./clean_ticks"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i){function o(r){var n=t[r];return void 0!==n?n:(e._template||{})[r]}var l=o("tick0"),s=o("dtick"),c=o("tickvals"),u=r("tickmode",a(c)?"array":s?"linear":"auto");if("auto"===u)r("nticks");else if("linear"===u){var f=e.dtick=n.dtick(s,i);e.tick0=n.tick0(l,i,e.calendar,f)}else if("multicategory"!==i){void 0===r("tickvals")?e.tickmode="auto":r("ticktext")}}},{"../../lib":233,"./clean_ticks":284}],303:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=t("../../components/drawing"),l=t("./axes");e.exports=function(t,e,r,s){var c=t._fullLayout;if(0!==e.length){var u,f,d,p;s&&(u=s());var h=n.ease(r.easing);return t._transitionData._interruptCallbacks.push((function(){return window.cancelAnimationFrame(p),p=null,function(){for(var r={},n=0;n<e.length;n++){var i=e[n],o=i.plotinfo.xaxis,l=i.plotinfo.yaxis;i.xr0&&(r[o._name+".range"]=i.xr0.slice()),i.yr0&&(r[l._name+".range"]=i.yr0.slice())}return a.call("relayout",t,r).then((function(){for(var t=0;t<e.length;t++)g(e[t].plotinfo)}))}()})),f=Date.now(),p=window.requestAnimationFrame((function n(){d=Date.now();for(var i=Math.min(1,(d-f)/r.duration),o=h(i),l=0;l<e.length;l++)v(e[l],o);d-f>r.duration?(!function(){for(var r={},n=0;n<e.length;n++){var i=e[n],o=i.plotinfo.xaxis,l=i.plotinfo.yaxis;i.xr1&&(r[o._name+".range"]=i.xr1.slice()),i.yr1&&(r[l._name+".range"]=i.yr1.slice())}u&&u(),a.call("relayout",t,r).then((function(){for(var t=0;t<e.length;t++)g(e[t].plotinfo)}))}(),p=window.cancelAnimationFrame(n)):p=window.requestAnimationFrame(n)})),Promise.resolve()}function g(t){var e=t.xaxis,r=t.yaxis;c._defs.select("#"+t.clipId+"> rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function v(e,r){var n=e.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!e.xr1,d=!!e.yr1,p=[];if(f){var h=i.simpleMap(e.xr0,a.r2l),g=i.simpleMap(e.xr1,a.r2l),v=h[1]-h[0],m=g[1]-g[0];p[0]=(h[0]*(1-r)+r*g[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*m/v),a.range[0]=a.l2r(h[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(e.yr0,s.r2l),x=i.simpleMap(e.yr1,s.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(t,a,{skipTitle:!0}),l.drawOne(t,s,{skipTitle:!0}),l.redrawComponents(t,[a._id,s._id]);var w=f?c/p[2]:1,T=d?u/p[3]:1,k=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,k,M).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(t)}},{"../../components/drawing":127,"../../lib":233,"../../registry":326,"./axes":279,d3:21}],304:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,a=t("./axis_autotype");function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=i(t),a=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return a&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,l=t._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(t,e,r){for(var n=0;n<t.length;n++){var a=t[n];if("splom"===a.type&&a._length>0&&(a["_"+r+"axes"]||{})[e])return a;if((a[r+"axis"]||r)===e){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(e,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=s+"calendar",f=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0);if(d.autotypenumbers=t.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r<e.length;r++){var g=e[r];n(g,"box-violin")&&(g[s+"axis"]||s)===l&&(void 0!==g[p]?h.push(g[p][0]):void 0!==g.name?h.push(g.name):h.push("text"),g[u]!==f&&(f=void 0))}t.type=a(h,f,d)}else if("splom"===c.type){var v=c.dimensions[c._axesDim[l]];v.visible&&(t.type=a(v.values,f,d))}else t.type=a(c[s]||[c[s+"0"]],f,d)}(e,l.data),"-"===e.type?e.type="linear":t.type=e.type)}},{"../../registry":326,"./axis_autotype":280}],305:[function(t,e,r){"use strict";var n=t("../registry"),a=t("../lib");function i(t,e,r){var n,i,o,l=!1;if("data"===e.type)n=t._fullData[null!==e.traces?e.traces[0]:0];else{if("layout"!==e.type)return!1;n=t._fullLayout}return i=a.nestedProperty(n,e.prop).get(),(o=r[e.type]=r[e.type]||{}).hasOwnProperty(e.prop)&&o[e.prop]!==i&&(l=!0),o[e.prop]=i,{changed:l,value:i}}function o(t,e){var r=[],n=e[0],i={};if("string"==typeof n)i[n]=e[1];else{if(!a.isPlainObject(n))return r;i=n}return s(i,(function(t,e,n){r.push({type:"layout",prop:t,value:n})}),"",0),r}function l(t,e){var r,n,i,o,l=[];if(n=e[0],i=e[1],r=e[2],o={},"string"==typeof n)o[n]=i;else{if(!a.isPlainObject(n))return l;o=n,void 0===r&&(r=i)}return void 0===r&&(r=null),s(o,(function(e,n,a){var i,o;if(Array.isArray(a)){o=a.slice();var s=Math.min(o.length,t.data.length);r&&(s=Math.min(s,r.length)),i=[];for(var c=0;c<s;c++)i[c]=r?r[c]:c}else o=a,i=r?r.slice():null;if(null===i)Array.isArray(o)&&(o=o[0]);else if(Array.isArray(i)){if(!Array.isArray(o)){var u=o;o=[];for(var f=0;f<i.length;f++)o[f]=u}o.length=Math.min(i.length,o.length)}l.push({type:"data",prop:e,traces:i,value:o})}),"",0),l}function s(t,e,r,n){Object.keys(t).forEach((function(i){var o=t[i];if("_"!==i[0]){var l=r+(n>0?".":"")+i;a.isPlainObject(o)?s(o,e,l,n+1):e(l,i,o)}}))}r.manageCommandObserver=function(t,e,n,o){var l={},s=!0;e&&e._commandObserver&&(l=e._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,l.lookupTable);if(e&&e._commandObserver){if(c)return l;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,l}if(c){i(t,c,l.cache),l.check=function(){if(s){var e=i(t,c,l.cache);return e.changed&&o&&void 0!==l.lookupTable[e.value]&&(l.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[e.value]})).then(l.enable,l.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f<u.length;f++)t._internalOn(u[f],l.check);l.remove=function(){for(var e=0;e<u.length;e++)t._removeInternalListener(u[e],l.check)}}else a.log("Unable to automatically bind plot updates to API command"),l.lookupTable={},l.remove=function(){};return l.disable=function(){s=!1},l.enable=function(){s=!0},e&&(e._commandObserver=l),l},r.hasSimpleAPICommandBindings=function(t,e,n){var a,i,o=e.length;for(a=0;a<o;a++){var l,s=e[a],c=s.method,u=s.args;if(Array.isArray(u)||(u=[]),!c)return!1;var f=r.computeAPICommandBindings(t,c,u);if(1!==f.length)return!1;if(i){if((l=f[0]).type!==i.type)return!1;if(l.prop!==i.prop)return!1;if(Array.isArray(i.traces)){if(!Array.isArray(l.traces))return!1;l.traces.sort();for(var d=0;d<i.traces.length;d++)if(i.traces[d]!==l.traces[d])return!1}else if(l.prop!==i.prop)return!1}else i=f[0],Array.isArray(i.traces)&&i.traces.sort();var p=(l=f[0]).value;if(Array.isArray(p)){if(1!==p.length)return!1;p=p[0]}n&&(n[p]=a)}return i},r.executeAPICommand=function(t,e,r){if("skip"===e)return Promise.resolve();var i=n.apiMethodRegistry[e],o=[t];Array.isArray(r)||(r=[]);for(var l=0;l<r.length;l++)o.push(r[l]);return i.apply(null,o).catch((function(t){return a.warn("API call to Plotly."+e+" rejected.",t),Promise.reject(t)}))},r.computeAPICommandBindings=function(t,e,r){var n;switch(Array.isArray(r)||(r=[]),e){case"restyle":n=l(t,r);break;case"relayout":n=o(t,r);break;case"update":n=l(t,[r[0],r[2]]).concat(o(t,[r[1]]));break;case"animate":n=function(t,e){return Array.isArray(e[0])&&1===e[0].length&&-1!==["string","number"].indexOf(typeof e[0][0])?[{type:"layout",prop:"_currentFrame",value:e[0][0].toString()}]:[]}(0,r);break;default:n=[]}return n}},{"../lib":233,"../registry":326}],306:[function(t,e,r){"use strict";var n=t("../lib/extend").extendFlat;r.attributes=function(t,e){e=e||{};var r={valType:"info_array",editType:(t=t||{}).editType,items:[{valType:"number",min:0,max:1,editType:t.editType},{valType:"number",min:0,max:1,editType:t.editType}],dflt:[0,1]},a=(t.name&&t.name,t.trace,e.description&&e.description,{x:n({},r,{}),y:n({},r,{}),editType:t.editType});return t.noGridCell||(a.row={valType:"integer",min:0,dflt:0,editType:t.editType},a.column={valType:"integer",min:0,dflt:0,editType:t.editType}),a},r.defaults=function(t,e,r,n){var a=n&&n.x||[0,1],i=n&&n.y||[0,1],o=e.grid;if(o){var l=r("domain.column");void 0!==l&&(l<o.columns?a=o._domains.x[l]:delete t.domain.column);var s=r("domain.row");void 0!==s&&(s<o.rows?i=o._domains.y[s]:delete t.domain.row)}var c=r("domain.x",a),u=r("domain.y",i);c[0]<c[1]||(t.domain.x=a.slice()),u[0]<u[1]||(t.domain.y=i.slice())}},{"../lib/extend":227}],307:[function(t,e,r){"use strict";e.exports=function(t){var e=t.editType,r=t.colorEditType;void 0===r&&(r=e);var n={family:{valType:"string",noBlank:!0,strict:!0,editType:e},size:{valType:"number",min:1,editType:e},color:{valType:"color",editType:r},editType:e};return t.arrayOk&&(n.family.arrayOk=!0,n.size.arrayOk=!0,n.color.arrayOk=!0),n}},{}],308:[function(t,e,r){"use strict";e.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}},{}],309:[function(t,e,r){"use strict";var n=t("../registry"),a=t("./cartesian/constants").SUBPLOT_PATTERN;r.getSubplotCalcData=function(t,e,r){var a=n.subplotsRegistry[e];if(!a)return[];for(var i=a.attr,o=[],l=0;l<t.length;l++){var s=t[l];s[0].trace[i]===r&&o.push(s)}return o},r.getModuleCalcData=function(t,e){var r,a=[],i=[];if(!(r="string"==typeof e?n.getModule(e).plot:"function"==typeof e?e:e.plot))return[a,t];for(var o=0;o<t.length;o++){var l=t[o],s=l[0].trace;!0===s.visible&&0!==s._length&&(s._module.plot===r?a.push(l):i.push(l))}return[a,i]},r.getSubplotData=function(t,e,r){if(!n.subplotsRegistry[e])return[];var i,o,l,s=n.subplotsRegistry[e].attr,c=[];if("gl2d"===e){var u=r.match(a);o="x"+u[1],l="y"+u[2]}for(var f=0;f<t.length;f++)i=t[f],"gl2d"===e&&n.traceIs(i,"gl2d")?i[s[0]]===o&&i[s[1]]===l&&c.push(i):i[s]===r&&c.push(i);return c}},{"../registry":326,"./cartesian/constants":285}],310:[function(t,e,r){"use strict";function n(t,e){var r,n,a=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)a[n]+=t[4*r+n]*e[r];return a}e.exports=function(t,e){return n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])))}},{}],311:[function(t,e,r){"use strict";var n=t("./font_attributes"),a=t("./animation_attributes"),i=t("../components/color/attributes"),o=t("../components/shapes/draw_newshape/attributes"),l=t("./pad_attributes"),s=t("../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,e.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"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:i.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:i.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},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":104,"../components/shapes/draw_newshape/attributes":187,"../lib/extend":227,"./animation_attributes":273,"./font_attributes":307,"./pad_attributes":312}],312:[function(t,e,r){"use strict";e.exports=function(t){var e=t.editType;return{t:{valType:"number",dflt:0,editType:e},r:{valType:"number",dflt:0,editType:e},b:{valType:"number",dflt:0,editType:e},l:{valType:"number",dflt:0,editType:e},editType:e}}},{}],313:[function(t,e,r){"use strict";var n=t("d3"),a=t("d3-time-format").timeFormatLocale,i=t("fast-isnumeric"),o=t("../registry"),l=t("../plot_api/plot_schema"),s=t("../plot_api/plot_template"),c=t("../lib"),u=t("../components/color"),f=t("../constants/numerical").BADNUM,d=t("./cartesian/axis_ids"),p=t("./cartesian/handle_outline").clearSelect,h=t("./animation_attributes"),g=t("./frame_attributes"),v=t("../plots/get_data").getModuleCalcData,m=c.relinkPrivateKeys,y=c._,x=e.exports={};c.extendFlat(x,o),x.attributes=t("./attributes"),x.attributes.type.values=x.allTypes,x.fontAttrs=t("./font_attributes"),x.layoutAttributes=t("./layout_attributes"),x.fontWeight="normal";var b=x.transformsRegistry,_=t("./command");x.executeAPICommand=_.executeAPICommand,x.computeAPICommandBindings=_.computeAPICommandBindings,x.manageCommandObserver=_.manageCommandObserver,x.hasSimpleAPICommandBindings=_.hasSimpleAPICommandBindings,x.redrawText=function(t){var e=(t=c.getGraphDiv(t))._fullLayout||{};if(!(!(e._has&&e._has("polar"))&&t.data&&t.data[0]&&t.data[0].r))return new Promise((function(e){setTimeout((function(){o.getComponentMethod("annotations","draw")(t),o.getComponentMethod("legend","draw")(t),o.getComponentMethod("colorbar","draw")(t),e(x.previousPromises(t))}),300)}))},x.resize=function(t){var e;t=c.getGraphDiv(t);var r=new Promise((function(r,n){t&&!c.isHidden(t)||n(new Error("Resize must be passed a displayed plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._resolveResize&&(e=t._resolveResize),t._resolveResize=r,t._redrawTimer=setTimeout((function(){if(!t.layout||t.layout.width&&t.layout.height||c.isHidden(t))r(t);else{delete t.layout.width,delete t.layout.height;var e=t.changed;t.autoplay=!0,o.call("relayout",t,{autosize:!0}).then((function(){t.changed=e,t._resolveResize===r&&(delete t._resolveResize,r(t))}))}}),100)}));return e&&e(r),r},x.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then((function(){t._promises=[]}))},x.addLinks=function(t){if(t._context.showLink||t._context.showSources){var e=t._fullLayout,r=c.ensureSingle(e._paper,"text","js-plot-link-container",(function(t){t.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:u.defaultLine,"pointer-events":"all"}).each((function(){var t=n.select(this);t.append("tspan").classed("js-link-to-tool",!0),t.append("tspan").classed("js-link-spacer",!0),t.append("tspan").classed("js-sourcelinks",!0)}))})),a=r.node(),i={y:e._paper.attr("height")-9};document.body.contains(a)&&a.getComputedTextLength()>=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),s=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",(function(){x.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(t,o),l.text(o.text()&&s.text()?" - ":"")}},x.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var w=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],T=["year","month","dayMonth","dayMonthYear"];function k(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,a={};function i(t){for(var r=!0,i=0;i<e.length;i++){var o=e[i];a[o]||(t[o]?a[o]=t[o]:r=!1)}r&&(n=!0)}for(var l=0;l<2;l++){for(var s=t._context.locales,c=0;c<2;c++){var u=(s[r]||{}).format;if(u&&(i(u),n))break;s=o.localeRegistry}var f=r.split("-")[0];if(n||f===r)break;r=f}return n||i(o.localeRegistry.en.format),a}function M(t,e){var r={_fullLayout:e},n="x"===t._id.charAt(0),a=t._mainAxis._anchorAxis,i="",o="",l="";if(a&&(l=a._mainAxis._id,i=n?t._id+l:l+t._id),!i||!e._plots[i]){i="";for(var s=t._counterAxes,c=0;c<s.length;c++){var u=s[c],f=n?t._id+u:u+t._id;o||(o=f);var p=d.getFromId(r,u);if(l&&p.overlaying===l){i=f;break}}}return i||o}function A(t){var e=t.transforms;if(Array.isArray(e)&&e.length)for(var r=0;r<e.length;r++){var n=e[r],a=n._module||b[n.type];if(a&&a.makesData)return!0}return!1}function L(t,e,r,n){for(var a=t.transforms,i=[t],o=0;o<a.length;o++){var l=a[o],s=b[l.type];s&&s.transform&&(i=s.transform(i,{transform:l,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:o}))}return i}function S(t){return"string"==typeof t&&"px"===t.substr(t.length-2)&&parseFloat(t)}function C(t){var e=t.margin;if(!t._size){var r=t._size={l:Math.round(e.l),r:Math.round(e.r),t:Math.round(e.t),b:Math.round(e.b),p:Math.round(e.pad)};r.w=Math.round(t.width)-r.l-r.r,r.h=Math.round(t.height)-r.t-r.b}t._pushmargin||(t._pushmargin={}),t._pushmarginIds||(t._pushmarginIds={})}x.supplyDefaults=function(t,e){var r=e&&e.skipUpdateCalc,i=t._fullLayout||{};if(i._skipDefaults)delete i._skipDefaults;else{var l,s=t._fullLayout={},u=t.layout||{},f=t._fullData||[],d=t._fullData=[],h=t.data||[],g=t.calcdata||[],v=t._context||{};t._transitionData||x.createTransitionData(t),s._dfltTitle={plot:y(t,"Click to enter Plot title"),x:y(t,"Click to enter X axis title"),y:y(t,"Click to enter Y axis title"),colorbar:y(t,"Click to enter Colorscale title"),annotation:y(t,"new text")},s._traceWord=y(t,"trace");var b=k(t,w);if(s._mapboxAccessToken=v.mapboxAccessToken,i._initialAutoSizeIsDone){var _=i.width,M=i.height;x.supplyLayoutGlobalDefaults(u,s,b),u.width||(s.width=_),u.height||(s.height=M),x.sanitizeMargins(s)}else{x.supplyLayoutGlobalDefaults(u,s,b);var A=!u.width||!u.height,L=s.autosize,S=v.autosizable;A&&(L||S)?x.plotAutoSize(t,u,s):A&&x.sanitizeMargins(s),!L&&A&&(u.width=s.width,u.height=s.height)}s._d3locale=function(t,e){return t.decimal=e.charAt(0),t.thousands=e.charAt(1),{numberFormat:n.locale(t).numberFormat,timeFormat:a(t).utcFormat}}(b,s.separators),s._extraFormat=k(t,T),s._initialAutoSizeIsDone=!0,s._dataLength=h.length,s._modules=[],s._visibleModules=[],s._basePlotModules=[];var O=s._subplots=function(){var t,e,r=o.collectableSubplotTypes,n={};if(!r){r=[];var a=o.subplotsRegistry;for(var i in a){var l=a[i].attr;if(l&&(r.push(i),Array.isArray(l)))for(e=0;e<l.length;e++)c.pushUnique(r,l[e])}}for(t=0;t<r.length;t++)n[r[t]]=[];return n}(),D=s._splomAxes={x:{},y:{}},z=s._splomSubplots={};s._splomGridDflt={},s._scatterStackOpts={},s._firstScatter={},s._alignmentOpts={},s._colorAxes={},s._requestRangeslider={},s._traceUids=function(t,e){var r,n,a=e.length,i=[];for(r=0;r<t.length;r++){var o=t[r]._fullInput;o!==n&&i.push(o),n=o}var l=i.length,s=new Array(a),u={};function f(t,e){s[e]=t,u[t]=1}function d(t,e){if(t&&"string"==typeof t&&!u[t])return f(t,e),!0}for(r=0;r<a;r++){var p=e[r].uid;"number"==typeof p&&(p=String(p)),d(p,r)||(r<l&&d(i[r].uid,r)||f(c.randstr(u),r))}return s}(f,h),s._globalTransforms=(t._context||{}).globalTransforms,x.supplyDataDefaults(h,d,u,s);var P=Object.keys(D.x),E=Object.keys(D.y);if(P.length>1&&E.length>1){for(o.getComponentMethod("grid","sizeDefaults")(u,s),l=0;l<P.length;l++)c.pushUnique(O.xaxis,P[l]);for(l=0;l<E.length;l++)c.pushUnique(O.yaxis,E[l]);for(var I in z)c.pushUnique(O.cartesian,I)}if(s._has=x._hasPlotType.bind(s),f.length===d.length)for(l=0;l<d.length;l++)m(d[l],f[l]);x.supplyLayoutModuleDefaults(u,s,d,t._transitionData);var R=s._visibleModules,F=[];for(l=0;l<R.length;l++){var N=R[l].crossTraceDefaults;N&&c.pushUnique(F,N)}for(l=0;l<F.length;l++)F[l](d,s);s._hasOnlyLargeSploms=1===s._basePlotModules.length&&"splom"===s._basePlotModules[0].name&&P.length>15&&E.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),x.linkSubplots(d,s,f,i),x.cleanPlot(d,s,f,i);var B=!(!i._has||!i._has("gl2d")),H=!(!s._has||!s._has("gl2d")),j=!(!i._has||!i._has("cartesian"))||B,U=!(!s._has||!s._has("cartesian"))||H;j&&!U?i._bgLayer.remove():U&&!j&&(s._shouldCreateBgLayer=!0),i._zoomlayer&&!t._dragging&&p({_fullLayout:i}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var a=0;a<t.length;a++){var i=t[a];i.meta?n[i.index]=i._meta={meta:i.meta}:e.meta&&(i._meta={meta:e.meta}),e.meta&&(i._meta.layout={meta:e.meta})}n.length&&(r||(r=e._meta={}),r.data=n)}(d,s),m(s,i),o.getComponentMethod("colorscale","crossTraceDefaults")(d,s),s._preGUI||(s._preGUI={}),s._tracePreGUI||(s._tracePreGUI={});var V,q=s._tracePreGUI,G={};for(V in q)G[V]="old";for(l=0;l<d.length;l++)G[V=d[l]._fullInput.uid]||(q[V]={}),G[V]="new";for(V in G)"old"===G[V]&&delete q[V];C(s),o.getComponentMethod("rangeslider","makeData")(s),r||g.length!==d.length||x.supplyDefaultsUpdateCalc(g,d)}},x.supplyDefaultsUpdateCalc=function(t,e){for(var r=0;r<e.length;r++){var n=e[r],a=(t[r]||[])[0];if(a&&a.trace){var i=a.trace;if(i._hasCalcTransform){var o,l,s,u=i._arrayAttrs;for(o=0;o<u.length;o++)l=u[o],s=c.nestedProperty(i,l).get().slice(),c.nestedProperty(n,l).set(s)}a.trace=n}}},x.createTransitionData=function(t){t._transitionData||(t._transitionData={}),t._transitionData._frames||(t._transitionData._frames=[]),t._transitionData._frameHash||(t._transitionData._frameHash={}),t._transitionData._counter||(t._transitionData._counter=0),t._transitionData._interruptCallbacks||(t._transitionData._interruptCallbacks=[])},x._hasPlotType=function(t){var e,r=this._basePlotModules||[];for(e=0;e<r.length;e++)if(r[e].name===t)return!0;var n=this._modules||[];for(e=0;e<n.length;e++){var a=n[e].name;if(a===t)return!0;var i=o.modules[a];if(i&&i.categories[t])return!0}return!1},x.cleanPlot=function(t,e,r,n){var a,i,o=n._basePlotModules||[];for(a=0;a<o.length;a++){var l=o[a];l.clean&&l.clean(t,e,r,n)}var s=n._has&&n._has("gl"),c=e._has&&e._has("gl");s&&!c&&void 0!==n._glcontainer&&(n._glcontainer.selectAll(".gl-canvas").remove(),n._glcontainer.selectAll(".no-webgl").remove(),n._glcanvas=null);var u=!!n._infolayer;t:for(a=0;a<r.length;a++){var f=r[a].uid;for(i=0;i<t.length;i++){if(f===t[i].uid)continue t}u&&n._infolayer.select(".cb"+f).remove()}},x.linkSubplots=function(t,e,r,n){var a,i,l=n._plots||{},s=e._plots={},u=e._subplots,f={_fullData:t,_fullLayout:e},p=u.cartesian.concat(u.gl2d||[]);for(a=0;a<p.length;a++){var h,g=p[a],v=l[g],m=d.getFromId(f,g,"x"),y=d.getFromId(f,g,"y");for(v?h=s[g]=v:(h=s[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,i=0;i<t.length;i++){var x=t[i];if(x.xaxis===h.xaxis._id&&x.yaxis===h.yaxis._id&&!1===x.cliponaxis){h._hasClipOnAxisFalse=!0;break}}}var b,_=d.list(f,null,!0);for(a=0;a<_.length;a++){var w=null;(b=_[a]).overlaying&&(w=d.getFromId(f,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:d.getFromId(f,b.anchor)}for(a=0;a<_.length;a++)if((b=_[a])._counterAxes.sort(d.idSort),b._subplotsWith.sort(c.subplotSort),b._mainSubplot=M(b,e),b._counterAxes.length&&(b.spikemode&&-1!==b.spikemode.indexOf("across")||b.automargin&&b.mirror&&"free"!==b.anchor||o.getComponentMethod("rangeslider","isVisible")(b))){var T=1,k=0;for(i=0;i<b._counterAxes.length;i++){var A=d.getFromId(f,b._counterAxes[i]);T=Math.min(T,A.domain[0]),k=Math.max(k,A.domain[1])}T<k&&(b._counterDomainMin=T,b._counterDomainMax=k)}},x.clearExpandedTraceDefaultColors=function(t){var e,r,n;for(r=[],(e=t._module._colorAttrs)||(t._module._colorAttrs=e=[],l.crawl(t._module.attributes,(function(t,n,a,i){r[i]=n,r.length=i+1,"color"===t.valType&&void 0===t.dflt&&e.push(r.join("."))}))),n=0;n<e.length;n++){c.nestedProperty(t,"_input."+e[n]).get()||c.nestedProperty(t,e[n]).set(null)}},x.supplyDataDefaults=function(t,e,r,n){var a,i,l,u=n._modules,f=n._visibleModules,d=n._basePlotModules,p=0,h=0;function g(t){e.push(t);var r=t._module;r&&(c.pushUnique(u,r),!0===t.visible&&c.pushUnique(f,r),c.pushUnique(d,t._module.basePlotModule),p++,!1!==t._input.visible&&h++)}n._transformModules=[];var v={},y=[],b=(r.template||{}).data||{},_=s.traceTemplater(b);for(a=0;a<t.length;a++){if(l=t[a],(i=_.newTrace(l)).uid=n._traceUids[a],x.supplyTraceDefaults(l,i,h,n,a),i.index=a,i._input=l,i._expandedIndex=p,i.transforms&&i.transforms.length)for(var w=!1!==l.visible&&!1===i.visible,T=L(i,e,r,n),k=0;k<T.length;k++){var M=T[k],A={_template:i._template,type:i.type,uid:i.uid+k};w&&!1===M.visible&&delete M.visible,x.supplyTraceDefaults(M,A,p,n,a),m(A,M),A.index=a,A._input=l,A._fullInput=i,A._expandedIndex=p,A._expandedInput=M,g(A)}else i._fullInput=i,i._expandedInput=i,g(i);o.traceIs(i,"carpetAxis")&&(v[i.carpet]=i),o.traceIs(i,"carpetDependent")&&y.push(a)}for(a=0;a<y.length;a++)if((i=e[y[a]]).visible){var S=v[i.carpet];i._carpet=S,S&&S.visible?(i.xaxis=S.xaxis,i.yaxis=S.yaxis):i.visible=!1}},x.supplyAnimationDefaults=function(t){var e;t=t||{};var r={};function n(e,n){return c.coerce(t||{},r,h,e,n)}if(n("mode"),n("direction"),n("fromcurrent"),Array.isArray(t.frame))for(r.frame=[],e=0;e<t.frame.length;e++)r.frame[e]=x.supplyAnimationFrameDefaults(t.frame[e]||{});else r.frame=x.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(r.transition=[],e=0;e<t.transition.length;e++)r.transition[e]=x.supplyAnimationTransitionDefaults(t.transition[e]||{});else r.transition=x.supplyAnimationTransitionDefaults(t.transition||{});return r},x.supplyAnimationFrameDefaults=function(t){var e={};function r(r,n){return c.coerce(t||{},e,h.frame,r,n)}return r("duration"),r("redraw"),e},x.supplyAnimationTransitionDefaults=function(t){var e={};function r(r,n){return c.coerce(t||{},e,h.transition,r,n)}return r("duration"),r("easing"),e},x.supplyFrameDefaults=function(t){var e={};function r(r,n){return c.coerce(t,e,g,r,n)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),e},x.supplyTraceDefaults=function(t,e,r,n,a){var i,l=n.colorway||u.defaults,s=l[r%l.length];function f(r,n){return c.coerce(t,e,x.attributes,r,n)}var d=f("visible");f("type"),f("name",n._traceWord+" "+a),f("uirevision",n.uirevision);var p=x.getModule(e);if(e._module=p,p){var h=p.basePlotModule,g=h.attr,v=h.attributes;if(g&&v){var m=n._subplots,y="";if(d||"gl2d"!==h.name){if(Array.isArray(g))for(i=0;i<g.length;i++){var b=g[i],_=c.coerce(t,e,v,b);m[b]&&c.pushUnique(m[b],_),y+=_}else y=c.coerce(t,e,v,g);m[h.name]&&c.pushUnique(m[h.name],y)}}}return d&&(f("customdata"),f("ids"),f("meta"),o.traceIs(e,"showLegend")?(c.coerce(t,e,p.attributes.showlegend?p.attributes:x.attributes,"showlegend"),f("legendgroup"),e._dfltShowLegend=!0):e._dfltShowLegend=!1,p&&p.supplyDefaults(t,e,s,n),o.traceIs(e,"noOpacity")||f("opacity"),o.traceIs(e,"notLegendIsolatable")&&(e.visible=!!e.visible),o.traceIs(e,"noHover")||(e.hovertemplate||c.coerceHoverinfo(t,e,n),"parcats"!==e.type&&o.getComponentMethod("fx","supplyDefaults")(t,e,s,n)),p&&p.selectPoints&&f("selectedpoints"),x.supplyTransformDefaults(t,e,n)),e},x.hasMakesDataTransform=A,x.supplyTransformDefaults=function(t,e,r){if(e._length||A(t)){var n=r._globalTransforms||[],a=r._transformModules||[];if(Array.isArray(t.transforms)||0!==n.length)for(var i=t.transforms||[],o=n.concat(i),l=e.transforms=[],s=0;s<o.length;s++){var u,f=o[s],d=f.type,p=b[d],h=!(f._module&&f._module===p),g=p&&"function"==typeof p.transform;p||c.warn("Unrecognized transform type "+d+"."),p&&p.supplyDefaults&&(h||g)?((u=p.supplyDefaults(f,e,r,t)).type=d,u._module=p,c.pushUnique(a,p)):u=c.extendFlat({},f),l.push(u)}}},x.supplyLayoutGlobalDefaults=function(t,e,r){function n(r,n){return c.coerce(t,e,x.layoutAttributes,r,n)}var a=t.template;c.isPlainObject(a)&&(e.template=a,e._template=a.layout,e._dataTemplate=a.data),n("autotypenumbers");var i=c.coerceFont(n,"font");n("title.text",e._dfltTitle.plot),c.coerceFont(n,"title.font",{family:i.family,size:Math.round(1.4*i.size),color:i.color}),n("title.xref"),n("title.yref"),n("title.x"),n("title.y"),n("title.xanchor"),n("title.yanchor"),n("title.pad.t"),n("title.pad.r"),n("title.pad.b"),n("title.pad.l"),n("uniformtext.mode")&&n("uniformtext.minsize"),n("autosize",!(t.width&&t.height)),n("width"),n("height"),n("margin.l"),n("margin.r"),n("margin.t"),n("margin.b"),n("margin.pad"),n("margin.autoexpand"),t.width&&t.height&&x.sanitizeMargins(e),o.getComponentMethod("grid","sizeDefaults")(t,e),n("paper_bgcolor"),n("separators",r.decimal+r.thousands),n("hidesources"),n("colorway"),n("datarevision");var l=n("uirevision");n("editrevision",l),n("selectionrevision",l),n("modebar.orientation"),n("modebar.bgcolor",u.addOpacity(e.paper_bgcolor,.5));var s=u.contrast(u.rgb(e.modebar.bgcolor));n("modebar.color",u.addOpacity(s,.3)),n("modebar.activecolor",u.addOpacity(s,.7)),n("modebar.uirevision",l),o.getComponentMethod("shapes","supplyDrawNewShapeDefaults")(t,e,n),n("meta"),c.isPlainObject(t.transition)&&(n("transition.duration"),n("transition.easing"),n("transition.ordering")),o.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),o.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,n)},x.plotAutoSize=function(t,e,r){var n,a,o=t._context||{},l=o.frameMargins,s=c.isPlotDiv(t);if(s&&t.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,a=window.innerHeight,document.body.style.overflow="hidden";else{var u=s?window.getComputedStyle(t):{};if(n=S(u.width)||S(u.maxWidth)||r.width,a=S(u.height)||S(u.maxHeight)||r.height,i(l)&&l>0){var f=1-2*l;n=Math.round(f*n),a=Math.round(f*a)}}var d=x.layoutAttributes.width.min,p=x.layoutAttributes.height.min;n<d&&(n=d),a<p&&(a=p);var h=!e.width&&Math.abs(r.width-n)>1,g=!e.height&&Math.abs(r.height-a)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i,l,s=o.componentsRegistry,u=e._basePlotModules,f=o.subplotsRegistry.cartesian;for(a in s)(l=s[a]).includeBasePlot&&l.includeBasePlot(t,e);for(var d in u.length||u.push(f),e._has("cartesian")&&(o.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[d].sort(c.subplotSort);for(i=0;i<u.length;i++)(l=u[i]).supplyLayoutDefaults&&l.supplyLayoutDefaults(t,e,r);var p=e._modules;for(i=0;i<p.length;i++)(l=p[i]).supplyLayoutDefaults&&l.supplyLayoutDefaults(t,e,r);var h=e._transformModules;for(i=0;i<h.length;i++)(l=h[i]).supplyLayoutDefaults&&l.supplyLayoutDefaults(t,e,r,n);for(a in s)(l=s[a]).supplyLayoutDefaults&&l.supplyLayoutDefaults(t,e,r)},x.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&(e._glcontainer.selectAll(".gl-canvas").remove(),e._glcontainer.remove(),e._glcanvas=null),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),c.clearThrottle(),c.clearResponsive(t),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.framework,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._promises,delete t._redrawTimer,delete t._hmlumcount,delete t._hmpixcount,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,delete t._transitioningWithDuration,delete t._dragging,delete t._dragged,delete t._dragdata,delete t._hoverdata,delete t._snapshotInProgress,delete t._editing,delete t._mouseDownTime,delete t._legendMouseDownTime,t.removeAllListeners&&t.removeAllListeners()},x.style=function(t){var e,r=t._fullLayout._visibleModules,n=[];for(e=0;e<r.length;e++){var a=r[e];a.style&&c.pushUnique(n,a.style)}for(e=0;e<n.length;e++)n[e](t)},x.sanitizeMargins=function(t){if(t&&t.margin){var e,r=t.width,n=t.height,a=t.margin,i=r-(a.l+a.r),o=n-(a.t+a.b);i<0&&(e=(r-1)/(a.l+a.r),a.l=Math.floor(e*a.l),a.r=Math.floor(e*a.r)),o<0&&(e=(n-1)/(a.t+a.b),a.t=Math.floor(e*a.t),a.b=Math.floor(e*a.b))}},x.clearAutoMarginIds=function(t){t._fullLayout._pushmarginIds={}},x.allowAutoMargin=function(t,e){t._fullLayout._pushmarginIds[e]=1};x.autoMargin=function(t,e,r){var n=t._fullLayout,a=n.width,i=n.height,o=n.margin,l=c.constrain(a-o.l-o.r,2,64),s=c.constrain(i-o.t-o.b,2,64),u=Math.max(0,a-l),f=Math.max(0,i-s),d=n._pushmargin,p=n._pushmarginIds;if(!1!==o.autoexpand){if(r){var h=r.pad;if(void 0===h&&(h=Math.min(12,o.l,o.r,o.t,o.b)),u){var g=(r.l+r.r)/u;g>1&&(r.l/=g,r.r/=g)}if(f){var v=(r.t+r.b)/f;v>1&&(r.t/=v,r.b/=v)}var m=void 0!==r.xl?r.xl:r.x,y=void 0!==r.xr?r.xr:r.x,b=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;d[e]={l:{val:m,size:r.l+h},r:{val:y,size:r.r+h},b:{val:_,size:r.b+h},t:{val:b,size:r.t+h}},p[e]=1}else delete d[e],delete p[e];if(!n._replotting)return x.doAutoMargin(t)}},x.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),C(e);var a=e._size,l=e.margin,s=c.extendFlat({},a),u=l.l,f=l.r,p=l.t,h=l.b,g=e._pushmargin,v=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var m in g)v[m]||delete g[m];for(var y in g.base={l:{val:0,size:u},r:{val:1,size:f},t:{val:1,size:p},b:{val:0,size:h}},g){var b=g[y].l||{},_=g[y].b||{},w=b.val,T=b.size,k=_.val,M=_.size;for(var A in g){if(i(T)&&g[A].r){var L=g[A].r.val,S=g[A].r.size;if(L>w){var O=(T*L+(S-r)*w)/(L-w),D=(S*(1-w)+(T-r)*(1-L))/(L-w);O+D>u+f&&(u=O,f=D)}}if(i(M)&&g[A].t){var z=g[A].t.val,P=g[A].t.size;if(z>k){var E=(M*z+(P-n)*k)/(z-k),I=(P*(1-k)+(M-n)*(1-z))/(z-k);E+I>h+p&&(h=E,p=I)}}}}}var R=c.constrain(r-l.l-l.r,2,64),F=c.constrain(n-l.t-l.b,2,64),N=Math.max(0,r-R),B=Math.max(0,n-F);if(N){var H=(u+f)/N;H>1&&(u/=H,f/=H)}if(B){var j=(h+p)/B;j>1&&(h/=j,p/=j)}if(a.l=Math.round(u),a.r=Math.round(f),a.t=Math.round(p),a.b=Math.round(h),a.p=Math.round(l.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!e._replotting&&x.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var U=3*(1+Object.keys(v).length);if(e._redrawFromAutoMarginCount<U)return o.call("plot",t);e._size=s,c.warn("Too many auto-margin redraws.")}!function(t){for(var e=d.list(t,"",!0),r=0;r<e.length;r++){var n=e[r]._hideOutOfRangeInsideTickLabels;n&&n()}}(t)};var O=["l","r","t","b","p","w","h"];function D(t,e,r){var n=!1;var a=[x.previousPromises,function(){if(t._transitionData)return t._transitioning=!1,function(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}(t._transitionData._interruptCallbacks)},r.prepareFn,x.rehover,function(){return t.emit("plotly_transitioning",[]),new Promise((function(a){t._transitioning=!0,e.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return o.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var i=0,l=0;function s(){return i++,function(){l++,n||l!==i||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return o.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(a)}}r.runFn(s),setTimeout(s())}))}],i=c.syncOrAsync(a,t);return i&&i.then||(i=Promise.resolve()),i.then((function(){return t}))}x.didMarginChange=function(t,e){for(var r=0;r<O.length;r++){var n=O[r],a=t[n],o=e[n];if(!i(a)||Math.abs(o-a)>1)return!0}return!1},x.graphJson=function(t,e,r,n,a,i){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&x.supplyDefaults(t);var o=a?t._fullData:t.data,l=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames;function u(t,e){if("function"==typeof t)return e?"_function_":null;if(c.isPlainObject(t)){var n,a={};return Object.keys(t).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof t[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0&&!c.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(t[i],e)}else e&&(a[i]="_function")})),a}return Array.isArray(t)?t.map((function(t){return u(t,e)})):c.isTypedArray(t)?c.simpleMap(t,c.identity):c.isJSDate(t)?c.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=u(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=u(l),a)){var d=l._size;f.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return t.framework&&t.framework.isPolar&&(f=t.framework.getConfig()),s&&(f.frames=u(s)),i&&(f.config=u(t._context,!0)),"object"===n?f:JSON.stringify(f)},x.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch((n=e[r]).type){case"replace":a=n.value;var l=(i[n.index]||{}).name,s=a.name;i[n.index]=o[s]=a,s!==l&&(delete o[l],o[s]=a);break;case"insert":o[(a=n.value).name]=a,i.splice(n.index,0,a);break;case"delete":delete o[(a=i[n.index]).name],i.splice(n.index,1)}return Promise.resolve()},x.computeFrame=function(t,e){var r,n,a,i,o=t._transitionData._frameHash;if(!e)throw new Error("computeFrame must be given a string frame name");var l=o[e.toString()];if(!l)return!1;for(var s=[l],c=[l.name];l.baseframe&&(l=o[l.baseframe.toString()])&&-1===c.indexOf(l.name);)s.push(l),c.push(l.name);for(var u={};l=s.pop();)if(l.layout&&(u.layout=x.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]=x.extendTrace(u.data[i],l.data[r]))}return u},x.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,n=0;n<r.length;n++){var a=r[n];a&&a.name&&(e[a.name]=a)}},x.extendObjectWithContainers=function(t,e,r){var n,a,i,o,l,s,u,f=c.extendDeepNoArrays({},e||{}),d=c.expandObjectPaths(f),p={};if(r&&r.length)for(i=0;i<r.length;i++)void 0===(a=(n=c.nestedProperty(d,r[i])).get())?c.nestedProperty(p,r[i]).set(null):(n.set(null),c.nestedProperty(p,r[i]).set(a));if(t=c.extendDeepNoArrays(t||{},d),r&&r.length)for(i=0;i<r.length;i++)if(s=c.nestedProperty(p,r[i]).get()){for(u=(l=c.nestedProperty(t,r[i])).get(),Array.isArray(u)||(u=[],l.set(u)),o=0;o<s.length;o++){var h=s[o];u[o]=null===h?null:x.extendObjectWithContainers(u[o],h)}l.set(u)}return t},x.dataArrayContainers=["transforms","dimensions"],x.layoutArrayContainers=o.layoutArrayContainers,x.extendTrace=function(t,e){return x.extendObjectWithContainers(t,e,x.dataArrayContainers)},x.extendLayout=function(t,e){return x.extendObjectWithContainers(t,e,x.layoutArrayContainers)},x.transition=function(t,e,r,n,a,i){var o={redraw:a.redraw},l={},s=[];return o.prepareFn=function(){for(var a=Array.isArray(e)?e.length:0,i=n.slice(0,a),o=0;o<i.length;o++){var u=i[o],f=t._fullData[u]._module;if(f){if(f.animatable){var d=f.basePlotModule.name;l[d]||(l[d]=[]),l[d].push(u)}t.data[i[o]]=x.extendTrace(t.data[i[o]],e[o])}}var p=c.expandObjectPaths(c.extendDeepNoArrays({},r)),h=/^[xy]axis[0-9]*$/;for(var g in p)h.test(g)&&delete p[g].range;x.extendLayout(t.layout,p),delete t.calcdata,x.supplyDefaults(t),x.doCalcdata(t);var v=c.expandObjectPaths(r);if(v){var m=t._fullLayout._plots;for(var y in m){var b=m[y],_=b.xaxis,w=b.yaxis,T=_.range.slice(),k=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()),T&&M&&(_.r2l(T[0])!==_.r2l(M[0])||_.r2l(T[1])!==_.r2l(M[1]))&&(L={xr0:T,xr1:M}),k&&A&&(w.r2l(k[0])!==w.r2l(A[0])||w.r2l(k[1])!==w.r2l(A[1]))&&(S={yr0:k,yr1:A}),(L||S)&&s.push(c.extendFlat({plotinfo:b},L,S))}}return Promise.resolve()},o.runFn=function(e){var n,a,o=t._fullLayout._basePlotModules,u=s.length;if(r)for(a=0;a<o.length;a++)o[a].transitionAxes&&o[a].transitionAxes(t,s,i,e);for(var f in u?((n=c.extendFlat({},i)).duration=0,delete l.cartesian):n=i,l){var d=l[f];t._fullData[d[0]]._module.basePlotModule.plot(t,d,n,e)}},D(t,i,o)},x.transitionFromReact=function(t,e,r,n){var a=t._fullLayout,i=a.transition,o={},l=[];return o.prepareFn=function(){var t=a._plots;for(var i in o.redraw=!1,"some"===e.anim&&(o.redraw=!0),"some"===r.anim&&(o.redraw=!0),t){var s=t[i],u=s.xaxis,f=s.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(c.extendFlat({plotinfo:s},v,m))}return Promise.resolve()},o.runFn=function(r){for(var n,a,o,s=t._fullData,u=t._fullLayout._basePlotModules,f=[],d=0;d<s.length;d++)f.push(d);function p(){for(var e=0;e<u.length;e++)u[e].transitionAxes&&u[e].transitionAxes(t,l,n,r)}function h(){for(var e=0;e<u.length;e++)u[e].plot(t,o,a,r)}l.length&&e.anim?"traces first"===i.ordering?(n=c.extendFlat({},i,{duration:0}),o=f,a=i,setTimeout(p,i.duration),h()):(n=i,o=null,a=c.extendFlat({},i,{duration:0}),setTimeout(h,n.duration),p()):l.length?(n=i,p()):e.anim&&(o=f,a=i,h())},D(t,i,o)},x.doCalcdata=function(t,e){var r,n,a,i,s=d.list(t),u=t._fullData,p=t._fullLayout,h=new Array(u.length),g=(t.calcdata||[]).slice();for(t.calcdata=h,p._numBoxes=0,p._numViolins=0,p._violinScaleGroupStats={},t._hmpixcount=0,t._hmlumcount=0,p._piecolormap={},p._sunburstcolormap={},p._treemapcolormap={},p._funnelareacolormap={},a=0;a<u.length;a++)Array.isArray(e)&&-1===e.indexOf(a)&&(h[a]=g[a]);for(a=0;a<u.length;a++)(r=u[a])._arrayAttrs=l.findArrayAttributes(r),r._extremes={};var v=p._subplots.polar||[];for(a=0;a<v.length;a++)s.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 x=!1;function _(e){if(r=u[e],n=r._module,!0===r.visible&&r.transforms){if(n&&n.calc){var a=n.calc(t,r);a[0]&&a[0].t&&a[0].t._scene&&delete a[0].t._scene.dirty}for(i=0;i<r.transforms.length;i++){var o=r.transforms[i];(n=b[o.type])&&n.calcTransform&&(r._hasCalcTransform=!0,x=!0,n.calcTransform(t,r,o))}}}function w(e,a){if(r=u[e],!!(n=r._module).isContainer===a){var o=[];if(!0===r.visible&&0!==r._length){delete r._indexToPoints;var l=r.transforms||[];for(i=l.length-1;i>=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,h[e]=o}}for(P(s,u,p),a=0;a<u.length;a++)w(a,!0);for(a=0;a<u.length;a++)_(a);for(x&&P(s,u,p),a=0;a<u.length;a++)w(a,!0);for(a=0;a<u.length;a++)w(a,!1);E(t);var T=function(t,e){var r,n,a,i,l,s=[];function u(t,r,n){var a=r._id.charAt(0);if("histogram2dcontour"===t){var i=r._counterAxes[0],o=d.getFromId(e,i),l="x"===a||"x"===i&&"category"===o.type,s="y"===a||"y"===i&&"category"===o.type;return function(t,e){return 0===t||0===e||l&&t===n[e].length-1||s&&e===n.length-1?-1:("y"===a?e:t)-1}}return function(t,e){return"y"===a?e:t}}var f={min:function(t){return c.aggNums(Math.min,null,t)},max:function(t){return c.aggNums(Math.max,null,t)},sum:function(t){return c.aggNums((function(t,e){return t+e}),null,t)},total:function(t){return c.aggNums((function(t,e){return t+e}),null,t)},mean:function(t){return c.mean(t)},median:function(t){return c.median(t)}};for(r=0;r<t.length;r++){var p=t[r];if("category"===p.type){var h=p.categoryorder.match(z);if(h){var g=h[1],v=h[2],m=p._id.charAt(0),y="x"===m,x=[];for(n=0;n<p._categories.length;n++)x.push([p._categories[n],[]]);for(n=0;n<p._traceIndices.length;n++){var b=p._traceIndices[n],_=e._fullData[b];if(!0===_.visible){var w=_.type;o.traceIs(_,"histogram")&&(delete _._xautoBinFinished,delete _._yautoBinFinished);var T="splom"===w,k="scattergl"===w,M=e.calcdata[b];for(a=0;a<M.length;a++){var A,L,S=M[a];if(T){var C=_._axesDim[p._id];if(!y){var O=_._diag[C][0];O&&(p=e._fullLayout[d.id2name(O)])}var D=S.trace.dimensions[C].values;for(i=0;i<D.length;i++)for(A=p._categoriesMap[D[i]],l=0;l<S.trace.dimensions.length;l++)if(l!==C){var P=S.trace.dimensions[l];x[A][1].push(P.values[i])}}else if(k){for(i=0;i<S.t.x.length;i++)y?(A=S.t.x[i],L=S.t.y[i]):(A=S.t.y[i],L=S.t.x[i]),x[A][1].push(L);S.t&&S.t._scene&&delete S.t._scene.dirty}else if(S.hasOwnProperty("z")){L=S.z;var E=u(_.type,p,L);for(i=0;i<L.length;i++)for(l=0;l<L[i].length;l++)(A=E(l,i))+1&&x[A][1].push(L[i][l])}else for(void 0===(A=S.p)&&(A=S[m]),void 0===(L=S.s)&&(L=S.v),void 0===L&&(L=y?S.y:S.x),Array.isArray(L)||(L=void 0===L?[]:[L]),i=0;i<L.length;i++)x[A][1].push(L[i])}}}p._categoriesValue=x;var I=[];for(n=0;n<x.length;n++)I.push([x[n][0],f[g](x[n][1])]);I.sort((function(t,e){return t[1]-e[1]})),p._categoriesAggregatedValue=I,p._initialCategories=I.map((function(t){return t[0]})),"descending"===v&&p._initialCategories.reverse(),s=s.concat(p.sortByInitialCategories())}}}return s}(s,t);if(T.length){for(p._numBoxes=0,p._numViolins=0,a=0;a<T.length;a++)w(T[a],!0);for(a=0;a<T.length;a++)w(T[a],!1);E(t)}o.getComponentMethod("fx","calc")(t),o.getComponentMethod("errorbars","calc")(t)};var z=/(total|sum|min|max|mean|median) (ascending|descending)/;function P(t,e,r){var n={};function a(t){t.clearCalc(),"multicategory"===t.type&&t.setupMultiCategory(e),n[t._id]=1}c.simpleMap(t,a);for(var i=r._axisMatchGroups||[],o=0;o<i.length;o++)for(var l in i[o])n[l]||a(r[d.id2name(l)])}function E(t){var e,r,n,a=t._fullLayout,i=a._visibleModules,o={};for(r=0;r<i.length;r++){var l=i[r],s=l.crossTraceCalc;if(s){var u=l.basePlotModule.name;o[u]?c.pushUnique(o[u],s):o[u]=[s]}}for(n in o){var f=o[n],d=a._subplots[n];if(Array.isArray(d))for(e=0;e<d.length;e++){var p=d[e],h="cartesian"===n?a._plots[p]:a[p];for(r=0;r<f.length;r++)f[r](t,h,p)}else for(r=0;r<f.length;r++)f[r](t)}}x.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},x.redrag=function(t){t._fullLayout._redrag&&t._fullLayout._redrag()},x.generalUpdatePerTraceModule=function(t,e,r,n){var a,i=e.traceHash,o={};for(a=0;a<r.length;a++){var l=r[a],s=l[0].trace;s.visible&&(o[s.type]=o[s.type]||[],o[s.type].push(l))}for(var u in i)if(!o[u]){var f=i[u][0];f[0].trace.visible=!1,o[u]=[f]}for(var d in o){var p=o[d];p[0][0].trace._module.plot(t,e,c.filterVisible(p),n)}e.traceHash=o},x.plotBasePlot=function(t,e,r,n,a){var i=o.getModule(t),l=v(e.calcdata,i)[0];i.plot(e,l,n,a)},x.cleanBasePlot=function(t,e,r,n,a){var i=a._has&&a._has(t),o=r._has&&r._has(t);i&&!o&&a["_"+t+"layer"].selectAll("g.trace").remove()}},{"../components/color":105,"../constants/numerical":212,"../lib":233,"../plot_api/plot_schema":267,"../plot_api/plot_template":268,"../plots/get_data":309,"../registry":326,"./animation_attributes":273,"./attributes":275,"./cartesian/axis_ids":282,"./cartesian/handle_outline":289,"./command":305,"./font_attributes":307,"./frame_attributes":308,"./layout_attributes":311,d3:21,"d3-time-format":19,"fast-isnumeric":23}],314:[function(t,e,r){"use strict";var n=t("../../../traces/scatter/attributes"),a=n.marker,i=t("../../../lib/extend").extendFlat;["Area traces are deprecated!","Please switch to the *barpolar* trace type."].join(" ");e.exports={r:i({},n.r,{}),t:i({},n.t,{}),marker:{color:i({},a.color,{}),size:i({},a.size,{}),symbol:i({},a.symbol,{}),opacity:i({},a.opacity,{}),editType:"calc"}}},{"../../../lib/extend":227,"../../../traces/scatter/attributes":447}],315:[function(t,e,r){"use strict";var n=t("../../cartesian/layout_attributes"),a=t("../../../lib/extend").extendFlat,i=t("../../../plot_api/edit_types").overrideAll,o=["Legacy polar charts are deprecated!","Please switch to *polar* subplots."].join(" "),l=a({},n.domain,{});function s(t,e){return a({},e,{showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number",description:o},visible:{valType:"boolean"}})}e.exports=i({radialaxis:s(0,{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:l,orientation:{valType:"number"}}),angularaxis:s(0,{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:l}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}},"plot","nested")},{"../../../lib/extend":227,"../../../plot_api/edit_types":261,"../../cartesian/layout_attributes":293}],316:[function(t,e,r){"use strict";(e.exports=t("./micropolar")).manager=t("./micropolar_manager")},{"./micropolar":317,"./micropolar_manager":318}],317:[function(t,e,r){var n=t("d3"),a=t("../../../lib").extendDeepAll,i=t("../../../constants/alignment").MID_SHIFT,o=e.exports={version:"0.2.2"};o.Axis=function(){var t,e,r,l,s={data:[],layout:{}},c={},u={},f=n.dispatch("hover"),d={};return d.render=function(c){return function(c){e=c||e;var f=s.data,d=s.layout;("string"==typeof e||e.nodeName)&&(e=n.select(e)),e.datum(f).each((function(e,s){var c=e.slice();u={data:o.util.cloneJson(c),layout:o.util.cloneJson(d)};var f=0;c.forEach((function(t,e){t.color||(t.color=d.defaultColorRange[f],f=(f+1)%d.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:n.rgb(t.color).darker().toString()),u.data[e].color=t.color,u.data[e].strokeColor=t.strokeColor,u.data[e].strokeDash=t.strokeDash,u.data[e].strokeSize=t.strokeSize}));var p=c.filter((function(t,e){var r=t.visible;return"undefined"==typeof r||!0===r})),h=!1,g=p.map((function(t,e){return h=h||"undefined"!=typeof t.groupId,t}));if(h){var v=n.nest().key((function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"})).entries(g),m=[],y=v.map((function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map((function(t,e){return 0}));return t.values.forEach((function(t,e,n){t.yStack=[r],m.push(r),r=o.util.sumArrays(t.r,r)})),t.values}));p=n.merge(y)}p.forEach((function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]}));var x=Math.min(d.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2;x=Math.max(10,x);var b,_=[d.margin.left+x,d.margin.top+x];h?b=[0,n.max(o.util.sumArrays(o.util.arrayLast(p).r[0],o.util.arrayLast(m)))]:b=n.extent(o.util.flattenArray(p.map((function(t,e){return t.r}))));d.radialAxis.domain!=o.DATAEXTENT&&(b[0]=0),r=n.scale.linear().domain(d.radialAxis.domain!=o.DATAEXTENT&&d.radialAxis.domain?d.radialAxis.domain:b).range([0,x]),u.layout.radialAxis.domain=r.domain();var w,T=o.util.flattenArray(p.map((function(t,e){return t.t}))),k="string"==typeof T[0];k&&(T=o.util.deduplicate(T),w=T.slice(),T=n.range(T.length),p=p.map((function(t,e){var r=t;return t.t=[T],h&&(r.yStack=t.yStack),r})));var M=p.filter((function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry})).length===p.length,A=null===d.needsEndSpacing?k||!M:d.needsEndSpacing,L=d.angularAxis.domain&&d.angularAxis.domain!=o.DATAEXTENT&&!k&&d.angularAxis.domain[0]>=0?d.angularAxis.domain:n.extent(T),S=Math.abs(T[1]-T[0]);M&&!k&&(S=0);var C=L.slice();A&&k&&(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 D=d.angularAxis.ticksStep||(C[1]-C[0])/(O*(d.minorTicks+1));w&&(D=Math.max(Math.round(D),1)),C[2]||(C[2]=D);var z=n.range.apply(this,C);if(z=z.map((function(t,e){return parseFloat(t.toPrecision(12))})),l=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=A?S:0,"undefined"==typeof(t=n.select(this).select("svg.chart-root"))||t.empty()){var P=(new DOMParser).parseFromString("<svg xmlns='http://www.w3.org/2000/svg' class='chart-root'>' + '<g class='outer-group'>' + '<g class='chart-group'>' + '<circle class='background-circle'></circle>' + '<g class='geometry-group'></g>' + '<g class='radial axis-group'>' + '<circle class='outside-circle'></circle>' + '</g>' + '<g class='angular axis-group'></g>' + '<g class='guides-group'><line></line><circle r='0'></circle></g>' + '</g>' + '<g class='legend-group'></g>' + '<g class='tooltips-group'></g>' + '<g class='title-group'><text></text></g>' + '</g>' + '</svg>","application/xml"),E=this.appendChild(this.ownerDocument.importNode(P.documentElement,!0));t=n.select(E)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var I,R=t.select(".chart-group"),F={fill:"none",stroke:d.tickColor},N={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map((function(t,e){return" "+t+" 0 "+d.font.outlineColor})).join(",")};if(d.showLegend){I=t.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var B=p.map((function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r}));o.Legend().config({data:p.map((function(t,e){return t.name||"Element"+e})),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:I,elements:B,reverseOrder:d.legend.reverseOrder})})();var H=I.node().getBBox();x=Math.min(d.width-H.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(),I.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else I=t.select(".legend-group").style({display:"none"});t.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var j=[(d.width-(d.margin.left+d.margin.right+2*x+(H?H.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]),t.select(".outer-group").attr("transform","translate("+j+")"),d.title&&d.title.text){var U=t.select("g.title-group text").style(N).text(d.title.text),V=U.node().getBBox();U.attr({x:_[0]-V.width/2,y:_[1]-x-20})}var q=t.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var G=q.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()}q.select("circle.outside-circle").attr({r:x}).style(F);var Z=t.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function Y(t,e){return l(t)%360+d.orientation}if(d.radialAxis.visible){var X=n.svg.axis().scale(r).ticks(5).tickSize(5);q.call(X).attr({transform:"rotate("+d.radialAxis.orientation+")"}),q.selectAll(".domain").style(F),q.selectAll("g>text").text((function(t,e){return this.textContent+d.radialAxis.ticksSuffix})).style(N).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),q.selectAll("g>line").style({stroke:"black"})}var W=t.select(".angular.axis-group").selectAll("g.angular-tick").data(z),Q=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(t,e){return"rotate("+Y(t)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),Q.append("line").classed("grid-line",!0).classed("major",(function(t,e){return e%(d.minorTicks+1)==0})).classed("minor",(function(t,e){return!(e%(d.minorTicks+1)==0)})).style(F),Q.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"}),Q.append("text").classed("axis-text",!0).style(N);var J=W.select("text.axis-text").attr({x:x+d.labelOffset,dy:i+"em",transform:function(t,e){var r=Y(t),n=x+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text((function(t,e){return e%(d.minorTicks+1)!=0?"":w?w[t]+d.angularAxis.ticksSuffix:t+d.angularAxis.ticksSuffix})).style(N);d.angularAxis.rewriteTicks&&J.text((function(t,e){return e%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,e)}));var $=n.max(R.selectAll(".angular-tick text")[0].map((function(t,e){return t.getCTM().e+t.getBBox().width})));I.attr({transform:"translate("+[x+$,d.margin.top]+")"});var K=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(p);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),p[0]||K){var et=[];p.forEach((function(t,e){var n={};n.radialScale=r,n.angularScale=l,n.container=tt.filter((function(t,r){return r==e})),n.geometry=t.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=e,et.push({data:t,geometryConfig:n})}));var rt=n.nest().key((function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"})).entries(et),nt=[];rt.forEach((function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map((function(t,e){return[t]}))):nt.push(t.values)})),nt.forEach((function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map((function(t,e){return a(o[r].defaultConfig(),t)}));o[r]().config(n)()}))}var at,it,ot=t.select(".guides-group"),lt=t.select(".tooltips-group"),st=o.tooltipPanel().config({container:lt,fontSize:8})(),ct=o.tooltipPanel().config({container:lt,fontSize:8})(),ut=o.tooltipPanel().config({container:lt,hasTick:!0})();if(!k){var ft=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",(function(t,e){var r=o.util.getMousePos(Z).angle;ft.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;at=l.invert(n);var a=o.util.convertToCartesian(x+12,r+180);st.text(o.util.round(at)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.angular-guide",(function(t,e){ot.select("line").style({opacity:0})}))}var dt=ot.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",(function(t,e){var n=o.util.getMousePos(Z).radius;dt.attr({r:n}).style({opacity:.5}),it=r.invert(o.util.getMousePos(Z).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ct.text(o.util.round(it)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(t,e){dt.style({opacity:0}),ut.hide(),st.hide(),ct.hide()})),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(e,r){var a=n.select(this),i=this.style.fill,l="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),l=n.hsl(i).darker().toString(),a.style({fill:l,opacity:1});var c={t:o.util.round(e[0]),r:o.util.round(e[1])};k&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=t.node().getBoundingClientRect(),p=[f.left+f.width/2-j[0]-d.left,f.top+f.height/2-j[1]-d.top];ut.config({color:l}).text(u),ut.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),l=n.hsl(i).darker().toString(),a.style({stroke:l,opacity:1})})).on("mousemove.tooltip",(function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ut.show()})).on("mouseout.tooltip",(function(t,e){ut.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(c),this},d.config=function(t){if(!arguments.length)return s;var e=o.util.cloneJson(t);return e.data.forEach((function(t,e){s.data[e]||(s.data[e]={}),a(s.data[e],o.Axis.defaultConfig().data[0]),a(s.data[e],t)})),a(s.layout,o.Axis.defaultConfig().layout),a(s.layout,e.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(t){return r},d.angularScale=function(t){return l},d.svg=function(){return t},n.rebind(d,f,"on"),d},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map((function(e,r){var n=e*Math.PI/180;return[e,t(n)]}))},o.util.dataFromEquation=function(t,e,r){var a=e||6,i=[],o=[];n.range(0,360+a,a).forEach((function(e,r){var n=e*Math.PI/180,a=t(n);i.push(e),o.push(a)}));var l={t:i,r:o};return r&&(l.name=r),l},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return n.range(e).map((function(t,e){return r[e]||r[0]}))},o.util.fillArrays=function(t,e,r){return e.forEach((function(e,n){t[e]=o.util.ensureArray(t[e],r)})),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map((function(t,e){return n.sum(t)}))},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter((function(t,e,r){return r.indexOf(t)==e}))},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],i={};return i.x=r,i.y=a,i.pos=e,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,i=t.length;a<i;a++)(e=t[a])in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},o.util.duplicates=function(t){return Object.keys(o.util.duplicatesCount(t))},o.util.translator=function(t,e,r,n){if(n){var a=r.slice();r=e,e=a}var i=e.reduce((function(t,e){if("undefined"!=typeof t)return t[e]}),t);"undefined"!=typeof i&&(e.reduce((function(t,r,n){if("undefined"!=typeof t)return n===e.length-1&&delete t[r],t[r]}),t),r.reduce((function(t,e,n){return"undefined"==typeof t[e]&&(t[e]={}),n===r.length-1&&(t[e]=i),t[e]}),t))},o.PolyChart=function(){var t=[o.PolyChart.defaultConfig()],e=n.dispatch("hover"),r={solid:"none",dash:[5,2],dot:[2,5]};function i(){var e=t[0].geometryConfig,a=e.container;"string"==typeof a&&(a=n.select(a)),a.datum(t).each((function(t,a){var i=!!t[0].data.yStack,o=t.map((function(t,e){return i?n.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):n.zip(t.data.t[0],t.data.r[0])})),l=e.angularScale,s=e.radialScale.domain()[0],c={bar:function(r,a,i){var o=t[i].data,s=e.radialScale(r[1])-e.radialScale(0),c=e.radialScale(r[2]||0),u=o.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[s+c,-u/2],[s+c,u/2],[c,u/2],[c,-u/2]].join("L")+"Z",transform:function(t,r){return"rotate("+(e.orientation+l(t[0]))+")"}})}};c.dot=function(r,a,i){var o=r[2]?[r[0],r[1]+r[2]]:r,l=n.svg.symbol().size(t[i].data.dotSize).type(t[i].data.dotType)(r,a);n.select(this).attr({class:"mark dot",d:l,transform:function(t,r){var n,a,i,l=(n=function(t,r){var n=e.radialScale(t[1]),a=(e.angularScale(t[0])+e.orientation)*Math.PI/180;return{r:n,t:a}}(o),a=n.r*Math.cos(n.t),i=n.r*Math.sin(n.t),{x:a,y:i});return"translate("+[l.x,l.y]+")"}})};var u=n.svg.line.radial().interpolate(t[0].data.lineInterpolation).radius((function(t){return e.radialScale(t[1])})).angle((function(t){return e.angularScale(t[0])*Math.PI/180}));c.line=function(r,a,i){var l=r[2]?o[i].map((function(t,e){return[t[0],t[1]+t[2]]})):o[i];if(n.select(this).each(c.dot).style({opacity:function(e,r){return+t[i].data.dotVisible},fill:h.stroke(r,a,i)}).attr({class:"mark dot"}),!(a>0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:u(l),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return h.fill(r,a,i)},"fill-opacity":0,stroke:function(t,e){return h.stroke(r,a,i)},"stroke-width":function(t,e){return h["stroke-width"](r,a,i)},"stroke-dasharray":function(t,e){return h["stroke-dasharray"](r,a,i)},opacity:function(t,e){return h.opacity(r,a,i)},display:function(t,e){return h.display(r,a,i)}})}};var f=e.angularScale.range(),d=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle((function(t){return-d/2})).endAngle((function(t){return d/2})).innerRadius((function(t){return e.radialScale(s+(t[2]||0))})).outerRadius((function(t){return e.radialScale(s+(t[2]||0))+e.radialScale(t[1])}));c.arc=function(t,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(t,r){return"rotate("+(e.orientation+l(t[0])+90)+")"}})};var h={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,a){return r[t[a].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return"undefined"==typeof t[n].data.visible||t[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data((function(t,e){return t}));v.enter().append("path").attr({class:"mark"}),v.style(h).each(c[e.geometryType]),v.exit().remove(),g.exit().remove()}))}return i.config=function(e){return arguments.length?(e.forEach((function(e,r){t[r]||(t[r]={}),a(t[r],o.PolyChart.defaultConfig()),a(t[r],e)})),this):t},i.getColorScale=function(){},n.rebind(i,e,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,i=t.data.map((function(t,r){return[].concat(t).map((function(t,n){var i=a({},e.elements[r]);return i.name=t,i.color=[].concat(e.elements[r].color)[n],i}))})),o=n.merge(i);o=o.filter((function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||"undefined"==typeof e.elements[r].visibleInLegend)})),e.reverseOrder&&(o=o.reverse());var l=e.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map((function(t,e){return t.color})),c=e.fontSize,u=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,f=u?e.height:c*o.length,d=l.classed("legend-group",!0).selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var h=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(h).range(s),v=n.scale[u?"linear":"ordinal"]().domain(h)[u?"range":"rangePoints"]([0,f]);if(u){var m=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);m.enter().append("stop"),m.attr({offset:function(t,e){return e/(s.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var y=d.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[c/2,v(e)+c/2]+")"},d:function(t,e){var r,a,i,o=t.symbol;return i=3*(a=c),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(t,e){return g(e)}}),y.exit().remove()}var x=n.svg.axis().scale(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?e.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?e.textColor:"none"}),b.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text((function(t,e){return o[e].name})),r}return r.config=function(e){return arguments.length?(a(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){var n=(t=i.container.selectAll("g."+l).data([0])).enter().append("g").classed(l,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+s,dy:.3*+i.fontSize}),c};return c.text=function(a){var o=n.hsl(i.color).l,l=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=a||"";e.style({fill:u,"font-size":i.fontSize+"px"}).text(f);var d=i.padding,p=e.node().getBBox(),h={fill:i.color,stroke:l,"stroke-width":"2px"},g=p.width+2*d+s,v=p.height+2*d;return r.attr({d:"M"+[[s,-v/2],[s,-v/4],[i.hasTick?0:s,0],[s,v/4],[s,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(h),t.attr({transform:"translate("+[s,-v/2+2*d]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return a(i,t),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map((function(t,r){var n=a({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n})),!e&&t.layout&&"stack"===t.layout.barmode)){var i=o.util.duplicates(r.data.map((function(t,e){return t.geometry})));r.data.forEach((function(t,e){var n=i.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)}))}if(t.layout){var l=a({},t.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e?("undefined"!=typeof l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&"undefined"!=typeof l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&"undefined"!=typeof l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&"undefined"!=typeof l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach((function(t,e){u[c[s.indexOf(t.key)]]=t.value})),l.margin=u}e&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r}};return t}},{"../../../constants/alignment":207,"../../../lib":233,d3:21}],318:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../../lib"),i=t("../../../components/color"),o=t("./micropolar"),l=t("./undo_manager"),s=a.extendDeepAll,c=e.exports={};c.framework=function(t){var e,r,a,i,u,f=new l;function d(r,l){return l&&(u=l),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?s(e,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(e),a.config(i).render(u),t.data=e.data,t.layout=e.layout,c.fillLayout(t),e}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return e},d.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},d.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},d.setUndoPoint=function(){var t,n,a=this,i=o.util.cloneJson(e);t=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(t)}}),r=o.util.cloneJson(i)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},c.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),a=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=s(o,t.layout)}},{"../../../components/color":105,"../../../lib":233,"./micropolar":317,"./undo_manager":319,d3:21}],319:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function a(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n||(e.splice(r+1,e.length-r),e.push(t),r=e.length-1),this},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(a(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(a(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r<e.length-1},getCommands:function(){return e},getPreviousCommand:function(){return e[r-1]},getIndex:function(){return r}}}},{}],320:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plot_api/plot_template"),i=t("./domain").defaults;e.exports=function(t,e,r,o){var l,s,c=o.type,u=o.attributes,f=o.handleDefaults,d=o.partition||"x",p=e._subplots[c],h=p.length,g=h&&p[0].replace(/\d+$/,"");function v(t,e){return n.coerce(l,s,u,t,e)}for(var m=0;m<h;m++){var y=p[m];l=t[y]?t[y]:t[y]={},s=a.newContainer(e,y,g),v("uirevision",e.uirevision);var x={};x[d]=[m/h,(m+1)/h],i(s,e,v,x),o.id=y,f(l,s,v,o)}}},{"../lib":233,"../plot_api/plot_template":268,"./domain":306}],321:[function(t,e,r){"use strict";['Variables are inserted using %{variable}, for example "y: %{y}".','Numbers are formatted using d3-format\'s syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".',t("../constants/docs").FORMAT_LINK,"for details on the formatting syntax.",'Dates are formatted using d3-time-format\'s syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".',t("../constants/docs").DATE_FORMAT_LINK,"for details on the date formatting syntax."].join(" ");function n(t){var e=t.description?" "+t.description:"",r=t.keys||[];if(r.length>0){for(var n=[],a=0;a<r.length;a++)n[a]="`"+r[a]+"`";e+="Finally, the template string has access to ",e=1===r.length?"variable "+n[0]:"variables "+n.slice(0,-1).join(", ")+" and "+n.slice(-1)+"."}return e}r.hovertemplateAttrs=function(t,e){t=t||{};n(e=e||{});var r={valType:"string",dflt:"",editType:t.editType||"none"};return!1!==t.arrayOk&&(r.arrayOk=!0),r},r.texttemplateAttrs=function(t,e){t=t||{};n(e=e||{});var r={valType:"string",dflt:"",editType:t.editType||"calc"};return!1!==t.arrayOk&&(r.arrayOk=!0),r}},{"../constants/docs":209}],322:[function(t,e,r){"use strict";var n=t("./ternary"),a=t("../../plots/get_data").getSubplotCalcData,i=t("../../lib").counterRegex;r.name="ternary";var o=r.attr="subplot";r.idRoot="ternary",r.idRegex=r.attrRegex=i("ternary"),(r.attributes={})[o]={valType:"subplotid",dflt:"ternary",editType:"calc"},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t.calcdata,i=e._subplots.ternary,o=0;o<i.length;o++){var l=i[o],s=a(r,"ternary",l),c=e[l]._subplot;c||(c=new n({id:l,graphDiv:t,container:e._ternarylayer.node()},e),e[l]._subplot=c),c.plot(s,e,t._promises)}},r.clean=function(t,e,r,n){for(var a=n._subplots.ternary||[],i=0;i<a.length;i++){var o=a[i],l=n[o]._subplot;!e[o]&&l&&(l.plotContainer.remove(),l.clipDef.remove(),l.clipDefRelative.remove(),l.layers["a-title"].remove(),l.layers["b-title"].remove(),l.layers["c-title"].remove())}}},{"../../lib":233,"../../plots/get_data":309,"./layout_attributes":323,"./layout_defaults":324,"./ternary":325}],323:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),a=t("../domain").attributes,i=t("../cartesian/layout_attributes"),o=t("../../plot_api/edit_types").overrideAll,l=t("../../lib/extend").extendFlat,s={title:{text:i.title.text,font:i.title.font},color:i.color,tickmode:i.tickmode,nticks:l({},i.nticks,{dflt:6,min:1}),tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,showticklabels:i.showticklabels,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,minexponent:i.minexponent,separatethousands:i.separatethousands,tickfont:i.tickfont,tickangle:i.tickangle,tickformat:i.tickformat,tickformatstops:i.tickformatstops,hoverformat:i.hoverformat,showline:l({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:l({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,layer:i.layer,min:{valType:"number",dflt:0,min:0},_deprecated:{title:i._deprecated.title,titlefont:i._deprecated.titlefont}},c=e.exports=o({domain:a({name:"ternary"}),bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:s,baxis:s,caxis:s},"plot","from-root");c.uirevision={valType:"any",editType:"none"},c.aaxis.uirevision=c.baxis.uirevision=c.caxis.uirevision={valType:"any",editType:"none"}},{"../../components/color/attributes":104,"../../lib/extend":227,"../../plot_api/edit_types":261,"../cartesian/layout_attributes":293,"../domain":306}],324:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../plot_api/plot_template"),i=t("../../lib"),o=t("../subplot_defaults"),l=t("../cartesian/tick_label_defaults"),s=t("../cartesian/tick_mark_defaults"),c=t("../cartesian/tick_value_defaults"),u=t("../cartesian/line_grid_defaults"),f=t("./layout_attributes"),d=["aaxis","baxis","caxis"];function p(t,e,r,i){var o,l,s,c=r("bgcolor"),u=r("sum");i.bgColor=n.combine(c,i.paper_bgcolor);for(var f=0;f<d.length;f++)l=t[o=d[f]]||{},(s=a.newContainer(e,o))._name=o,h(l,s,i,e);var p=e.aaxis,g=e.baxis,v=e.caxis;p.min+g.min+v.min>=u&&(p.min=0,g.min=0,v.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function h(t,e,r,n){var a=f[e._name];function o(r,n){return i.coerce(t,e,a,r,n)}o("uirevision",n.uirevision),e.type="linear";var d=o("color"),p=d!==a.color.dflt?d:r.font.color,h=e._name.charAt(0).toUpperCase(),g="Component "+h,v=o("title.text",g);e._hovertitle=v===g?v:h,i.coerceFont(o,"title.font",{family:r.font.family,size:Math.round(1.2*r.font.size),color:p}),o("min"),c(t,e,o,"linear"),l(t,e,o,"linear",{}),s(t,e,o,{outerTicks:!0}),o("showticklabels")&&(i.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:p}),o("tickangle"),o("tickformat")),u(t,e,o,{dfltColor:d,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),o("hoverformat"),o("layer")}e.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:f,handleDefaults:p,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../components/color":105,"../../lib":233,"../../plot_api/plot_template":268,"../cartesian/line_grid_defaults":295,"../cartesian/tick_label_defaults":300,"../cartesian/tick_mark_defaults":301,"../cartesian/tick_value_defaults":302,"../subplot_defaults":320,"./layout_attributes":323}],325:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("../../registry"),o=t("../../lib"),l=o.strTranslate,s=o._,c=t("../../components/color"),u=t("../../components/drawing"),f=t("../cartesian/set_convert"),d=t("../../lib/extend").extendFlat,p=t("../plots"),h=t("../cartesian/axes"),g=t("../../components/dragelement"),v=t("../../components/fx"),m=t("../../components/dragelement/helpers"),y=m.freeMode,x=m.rectMode,b=t("../../components/titles"),_=t("../cartesian/select").prepSelect,w=t("../cartesian/select").selectOnClick,T=t("../cartesian/select").clearSelect,k=t("../cartesian/select").clearSelectionsCache,M=t("../cartesian/constants");function A(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=A;var L=A.prototype;L.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},L.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var a=0;a<t.length;a++){if(!1===t[a][0].trace.cliponaxis){this._hasClipOnAxisFalse=!0;break}}this.updateLayers(r),this.adjustLayout(r,n),p.generalUpdatePerTraceModule(this.graphDiv,this,t,r),this.layers.plotbg.select("path").call(c.fill,r.bgcolor)},L.makeFramework=function(t){var e=this.graphDiv,r=t[this.id],n=this.clipId="clip"+this.layoutId+this.id,a=this.clipIdRelative="clip-relative"+this.layoutId+this.id;this.clipDef=o.ensureSingleById(t._clips,"clipPath",n,(function(t){t.append("path").attr("d","M0,0Z")})),this.clipDefRelative=o.ensureSingleById(t._clips,"clipPath",a,(function(t){t.append("path").attr("d","M0,0Z")})),this.plotContainer=o.ensureSingle(this.container,"g",this.id),this.updateLayers(r),u.setClipUrl(this.layers.backplot,n,e),u.setClipUrl(this.layers.grids,n,e)},L.updateLayers=function(t){var e=this.layers,r=["draglayer","plotbg","backplot","grids"];"below traces"===t.aaxis.layer&&r.push("aaxis","aline"),"below traces"===t.baxis.layer&&r.push("baxis","bline"),"below traces"===t.caxis.layer&&r.push("caxis","cline"),r.push("frontplot"),"above traces"===t.aaxis.layer&&r.push("aaxis","aline"),"above traces"===t.baxis.layer&&r.push("baxis","bline"),"above traces"===t.caxis.layer&&r.push("caxis","cline");var a=this.plotContainer.selectAll("g.toplevel").data(r,String),i=["agrid","bgrid","cgrid"];a.enter().append("g").attr("class",(function(t){return"toplevel "+t})).each((function(t){var r=n.select(this);e[t]=r,"frontplot"===t?r.append("g").classed("scatterlayer",!0):"backplot"===t?r.append("g").classed("maplayer",!0):"plotbg"===t?r.append("path").attr("d","M0,0Z"):"aline"===t||"bline"===t||"cline"===t?r.append("path"):"grids"===t&&i.forEach((function(t){e[t]=r.append("g").classed("grid "+t,!0)}))})),a.order()};var S=Math.sqrt(4/3);L.adjustLayout=function(t,e){var r,n,a,i,o,s,p=this,h=t.domain,g=(h.x[0]+h.x[1])/2,v=(h.y[0]+h.y[1])/2,m=h.x[1]-h.x[0],y=h.y[1]-h.y[0],x=m*e.w,b=y*e.h,_=t.sum,w=t.aaxis.min,T=t.baxis.min,k=t.caxis.min;x>S*b?a=(i=b)*S:i=(a=x)/S,o=m*a/x,s=y*i/b,r=e.l+e.w*g-a/2,n=e.t+e.h*(1-v)-i/2,p.x0=r,p.y0=n,p.w=a,p.h=i,p.sum=_,p.xaxis={type:"linear",range:[w+2*k-_,_-w-2*T],domain:[g-o/2,g+o/2],_id:"x"},f(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(t){return t.a>=p.aaxis.range[0]&&t.a<=p.aaxis.range[1]&&t.b>=p.baxis.range[1]&&t.b<=p.baxis.range[0]&&t.c>=p.caxis.range[1]&&t.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[w,_-T-k],domain:[v-s/2,v+s/2],_id:"y"},f(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var M=p.yaxis.domain[0],A=p.aaxis=d({},t.aaxis,{range:[w,_-T-k],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[M,M+s*S],anchor:"free",position:0,_id:"y",_length:a});f(A,p.graphDiv._fullLayout),A.setScale();var L=p.baxis=d({},t.baxis,{range:[_-w-k,T],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:a});f(L,p.graphDiv._fullLayout),L.setScale();var C=p.caxis=d({},t.caxis,{range:[_-w-T,k],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[M,M+s*S],anchor:"free",position:0,_id:"y",_length:a});f(C,p.graphDiv._fullLayout),C.setScale();var O="M"+r+","+(n+i)+"h"+a+"l-"+a/2+",-"+i+"Z";p.clipDef.select("path").attr("d",O),p.layers.plotbg.select("path").attr("d",O);var D="M0,"+i+"h"+a+"l-"+a/2+",-"+i+"Z";p.clipDefRelative.select("path").attr("d",D);var z=l(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",z),p.clipDefRelative.select("path").attr("transform",null);var P=l(r-L._offset,n+i);p.layers.baxis.attr("transform",P),p.layers.bgrid.attr("transform",P);var E=l(r+a/2,n)+"rotate(30)"+l(0,-A._offset);p.layers.aaxis.attr("transform",E),p.layers.agrid.attr("transform",E);var I=l(r+a/2,n)+"rotate(-30)"+l(0,-C._offset);p.layers.caxis.attr("transform",I),p.layers.cgrid.attr("transform",I),p.drawAxes(!0),p.layers.aline.select("path").attr("d",A.showline?"M"+r+","+(n+i)+"l"+a/2+",-"+i:"M0,0").call(c.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",L.showline?"M"+r+","+(n+i)+"h"+a:"M0,0").call(c.stroke,L.linecolor||"#000").style("stroke-width",(L.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",C.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+i:"M0,0").call(c.stroke,C.linecolor||"#000").style("stroke-width",(C.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),u.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},L.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,a=this.aaxis,i=this.baxis,o=this.caxis;if(this.drawAx(a),this.drawAx(i),this.drawAx(o),t){var l=Math.max(a.showticklabels?a.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0)),c=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;n["a-title"]=b.draw(e,"a"+r,{propContainer:a,propName:this.id+".aaxis.title",placeholder:s(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-a.title.font.size/3-l,"text-anchor":"middle"}}),n["b-title"]=b.draw(e,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:s(e,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*i.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=b.draw(e,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:s(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+c,y:this.y0+this.h+.83*o.title.font.size+c,"text-anchor":"middle"}})}},L.drawAx=function(t){var e,r=this.graphDiv,n=t._name,a=n.charAt(0),i=t._id,l=this.layers[n],s=a+"tickLayout",c=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);this[s]!==c&&(l.selectAll("."+i+"tick").remove(),this[s]=c),t.setScale();var u=h.calcTicks(t),f=h.clipEnds(t,u),d=h.makeTransTickFn(t),p=h.getTickSigns(t)[2],g=o.deg2rad(30),v=p*(t.linewidth||1)/2,m=p*t.ticklen,y=this.w,x=this.h,b="b"===a?"M0,"+v+"l"+Math.sin(g)*m+","+Math.cos(g)*m:"M"+v+",0l"+Math.cos(g)*m+","+-Math.sin(g)*m,_={a:"M0,0l"+x+",-"+y/2,b:"M0,0l-"+y/2+",-"+x,c:"M0,0l-"+x+","+y/2}[a];h.drawTicks(r,t,{vals:"inside"===t.ticks?f:u,layer:l,path:b,transFn:d,crisp:!1}),h.drawGrid(r,t,{vals:f,layer:this.layers[a+"grid"],path:_,transFn:d,crisp:!1}),h.drawLabels(r,t,{vals:u,layer:l,transFn:d,labelFns:h.makeLabelFns(t,0,30)})};var C=M.MINZOOM/2+.87,O="m-0.87,.5h"+C+"v3h-"+(C+5.2)+"l"+(C/2+2.6)+",-"+(.87*C+4.5)+"l2.6,1.5l-"+C/2+","+.87*C+"Z",D="m0.87,.5h-"+C+"v3h"+(C+5.2)+"l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-2.6,1.5l"+C/2+","+.87*C+"Z",z="m0,1l"+C/2+","+.87*C+"l2.6,-1.5l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-"+(C/2+2.6)+","+(.87*C+4.5)+"l2.6,1.5l"+C/2+",-"+.87*C+"Z",P=!0;function E(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}L.clearSelect=function(){k(this.dragOptions),T(this.dragOptions.gd)},L.initInteractions=function(){var t,e,r,n,f,d,p,h,m,b,T,k,A=this,L=A.layers.plotbg.select("path").node(),C=A.graphDiv,I=C._fullLayout._zoomlayer;function R(t){var e={};return e[A.id+".aaxis.min"]=t.a,e[A.id+".baxis.min"]=t.b,e[A.id+".caxis.min"]=t.c,e}function F(t,e){var r=C._fullLayout.clickmode;E(C),2===t&&(C.emit("plotly_doubleclick",null),i.call("_guiRelayout",C,R({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&w(e,C,[A.xaxis],[A.yaxis],A.id,A.dragOptions),r.indexOf("event")>-1&&v.click(C,e,A.id)}function N(t,e){return 1-e/A.h}function B(t,e){return 1-(t+(A.h-e)/Math.sqrt(3))/A.w}function H(t,e){return(t-(A.h-e)/Math.sqrt(3))/A.w}function j(a,i){var o=r+a*t,l=n+i*e,s=Math.max(0,Math.min(1,N(0,n),N(0,l))),c=Math.max(0,Math.min(1,B(r,n),B(o,l))),u=Math.max(0,Math.min(1,H(r,n),H(o,l))),g=(s/2+u)*A.w,v=(1-s/2-c)*A.w,y=(g+v)/2,x=v-g,_=(1-s)*A.h,w=_-x/S;x<M.MINZOOM?(p=f,T.attr("d",m),k.attr("d","M0,0Z")):(p={a:f.a+s*d,b:f.b+c*d,c:f.c+u*d},T.attr("d",m+"M"+g+","+_+"H"+v+"L"+y+","+w+"L"+g+","+_+"Z"),k.attr("d","M"+r+","+n+"m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2ZM"+g+","+_+O+"M"+v+","+_+D+"M"+y+","+w+z)),b||(T.transition().style("fill",h>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),k.transition().style("opacity",1).duration(200),b=!0),C.emit("plotly_relayouting",R(p))}function U(){E(C),p!==f&&(i.call("_guiRelayout",C,R(p)),P&&C.data&&C._context.showTips&&(o.notifier(s(C,"Double-click to zoom back out"),"long"),P=!1))}function V(t,e){var r=t/A.xaxis._m,n=e/A.yaxis._m,a=[(p={a:f.a-n,b:f.b+(r+n)/2,c:f.c-(r-n)/2}).a,p.b,p.c].sort(o.sorterAsc),i=a.indexOf(p.a),s=a.indexOf(p.b),c=a.indexOf(p.c);a[0]<0&&(a[1]+a[0]/2<0?(a[2]+=a[0]+a[1],a[0]=a[1]=0):(a[2]+=a[0]/2,a[1]+=a[0]/2,a[0]=0),p={a:a[i],b:a[s],c:a[c]},e=(f.a-p.a)*A.yaxis._m,t=(f.c-p.c-f.b+p.b)*A.xaxis._m);var d=l(A.x0+t,A.y0+e);A.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",d);var h=l(-t,-e);A.clipDefRelative.select("path").attr("transform",h),A.aaxis.range=[p.a,A.sum-p.b-p.c],A.baxis.range=[A.sum-p.a-p.c,p.b],A.caxis.range=[A.sum-p.a-p.b,p.c],A.drawAxes(!1),A._hasClipOnAxisFalse&&A.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,A),C.emit("plotly_relayouting",R(p))}function q(){i.call("_guiRelayout",C,R(p))}this.dragOptions={element:L,gd:C,plotinfo:{id:A.id,domain:C._fullLayout[A.id].domain,xaxis:A.xaxis,yaxis:A.yaxis},subplot:A.id,prepFn:function(i,s,u){A.dragOptions.xaxes=[A.xaxis],A.dragOptions.yaxes=[A.yaxis],t=C._fullLayout._invScaleX,e=C._fullLayout._invScaleY;var g=A.dragOptions.dragmode=C._fullLayout.dragmode;y(g)?A.dragOptions.minDrag=1:A.dragOptions.minDrag=void 0,"zoom"===g?(A.dragOptions.moveFn=j,A.dragOptions.clickFn=F,A.dragOptions.doneFn=U,function(t,e,i){var s=L.getBoundingClientRect();r=e-s.left,n=i-s.top,C._fullLayout._calcInverseTransform(C);var u=C._fullLayout._invTransform,g=o.apply3DTransform(u)(r,n);r=g[0],n=g[1],f={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},p=f,d=A.aaxis.range[1]-f.a,h=a(A.graphDiv._fullLayout[A.id].bgcolor).getLuminance(),m="M0,"+A.h+"L"+A.w/2+", 0L"+A.w+","+A.h+"Z",b=!1,T=I.append("path").attr("class","zoombox").attr("transform",l(A.x0,A.y0)).style({fill:h>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",m),k=I.append("path").attr("class","zoombox-corners").attr("transform",l(A.x0,A.y0)).style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),A.clearSelect(C)}(0,s,u)):"pan"===g?(A.dragOptions.moveFn=V,A.dragOptions.clickFn=F,A.dragOptions.doneFn=q,f={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},p=f,A.clearSelect(C)):(x(g)||y(g))&&_(i,s,u,A.dragOptions,g)}},L.onmousemove=function(t){v.hover(C,t,A.id),C._fullLayout._lasthover=L,C._fullLayout._hoversubplot=A.id},L.onmouseout=function(t){C._dragging||g.unhover(C,t)},g.init(this.dragOptions)}},{"../../components/color":105,"../../components/dragelement":124,"../../components/dragelement/helpers":123,"../../components/drawing":127,"../../components/fx":145,"../../components/titles":200,"../../lib":233,"../../lib/extend":227,"../../registry":326,"../cartesian/axes":279,"../cartesian/constants":285,"../cartesian/select":298,"../cartesian/set_convert":299,"../plots":313,d3:21,tinycolor2:88}],326:[function(t,e,r){"use strict";var n=t("./lib/loggers"),a=t("./lib/noop"),i=t("./lib/push_unique"),o=t("./lib/is_plain_object"),l=t("./lib/dom").addStyleRule,s=t("./lib/extend"),c=t("./plots/attributes"),u=t("./plots/layout_attributes"),f=s.extendFlat,d=s.extendDeepAll;function p(t){var e=t.name,a=t.categories,i=t.meta;if(r.modules[e])n.log("Type "+e+" already registered");else{r.subplotsRegistry[t.basePlotModule.name]||function(t){var e=t.name;if(r.subplotsRegistry[e])return void n.log("Plot type "+e+" already registered.");for(var a in m(t),r.subplotsRegistry[e]=t,r.componentsRegistry)b(a,t.name)}(t.basePlotModule);for(var o={},s=0;s<a.length;s++)o[a[s]]=!0,r.allCategories[a[s]]=!0;for(var c in r.modules[e]={_module:t,categories:o},i&&Object.keys(i).length&&(r.modules[e].meta=i),r.allTypes.push(e),r.componentsRegistry)y(c,e);t.layoutAttributes&&f(r.traceLayoutAttributes,t.layoutAttributes);var u=t.basePlotModule,d=u.name;if("mapbox"===d){var p=u.constants.styleRules;for(var h in p)l(".js-plotly-plot .plotly .mapboxgl-"+h,p[h])}"geo"!==d&&"mapbox"!==d||void 0===typeof window||void 0!==window.PlotlyGeoAssets||(window.PlotlyGeoAssets={topojson:{}})}}function h(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");var e=t.name;for(var n in r.componentsRegistry[e]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&i(r.layoutArrayContainers,e),m(t)),r.modules)y(e,n);for(var a in r.subplotsRegistry)b(e,a);for(var o in r.transformsRegistry)x(e,o);t.schema&&t.schema.layout&&d(u,t.schema.layout)}function g(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,a="function"==typeof t.transform,i="function"==typeof t.calcTransform;if(!a&&!i)throw new Error(e+" is missing a *transform* or *calcTransform* method.");for(var l in a&&i&&n.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),o(t.attributes)||n.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&n.log(e+" registered without a *supplyDefaults* method."),r.transformsRegistry[t.name]=t,r.componentsRegistry)x(l,t.name)}function v(t){var e=t.name,n=e.split("-")[0],a=t.dictionary,i=t.format,o=a&&Object.keys(a).length,l=i&&Object.keys(i).length,s=r.localeRegistry,c=s[e];if(c||(s[e]=c={}),n!==e){var u=s[n];u||(s[n]=u={}),o&&u.dictionary===c.dictionary&&(u.dictionary=a),l&&u.format===c.format&&(u.format=i)}o&&(c.dictionary=a),l&&(c.format=i)}function m(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n<e.length;n++)i(r.layoutArrayRegexes,e[n])}}function y(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.traces){var a=n.traces[e];a&&d(r.modules[e]._module.attributes,a)}}function x(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.transforms){var a=n.transforms[e];a&&d(r.transformsRegistry[e].attributes,a)}}function b(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.subplots){var a=r.subplotsRegistry[e],i=a.layoutAttributes,o="subplot"===a.attr?a.name:a.attr;Array.isArray(o)&&(o=o[0]);var l=n.subplots[o];i&&l&&d(i,l)}}function _(t){return"object"==typeof t&&(t=t.type),t}r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.layoutArrayRegexes=[],r.traceLayoutAttributes={},r.localeRegistry={},r.apiMethodRegistry={},r.collectableSubplotTypes=null,r.register=function(t){if(r.collectableSubplotTypes=null,!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e<t.length;e++){var n=t[e];if(!n)throw new Error("Invalid module was attempted to be registered!");switch(n.moduleType){case"trace":p(n);break;case"transform":g(n);break;case"component":h(n);break;case"locale":v(n);break;case"apiMethod":var a=n.name;r.apiMethodRegistry[a]=n.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},r.getModule=function(t){var e=r.modules[_(t)];return!!e&&e._module},r.traceIs=function(t,e){if("various"===(t=_(t)))return!1;var a=r.modules[t];return a||(t&&"area"!==t&&n.log("Unrecognized trace type "+t+"."),a=r.modules[c.type.dflt]),!!a.categories[e]},r.getTransformIndices=function(t,e){for(var r=[],n=t.transforms||[],a=0;a<n.length;a++)n[a].type===e&&r.push(a);return r},r.hasTransform=function(t,e){for(var r=t.transforms||[],n=0;n<r.length;n++)if(r[n].type===e)return!0;return!1},r.getComponentMethod=function(t,e){var n=r.componentsRegistry[t];return n&&n[e]||a},r.call=function(){var t=arguments[0],e=[].slice.call(arguments,1);return r.apiMethodRegistry[t].apply(null,e)}},{"./lib/dom":225,"./lib/extend":227,"./lib/is_plain_object":234,"./lib/loggers":237,"./lib/noop":242,"./lib/push_unique":247,"./plots/attributes":275,"./plots/layout_attributes":311}],327:[function(t,e,r){"use strict";var n=t("../registry"),a=t("../lib"),i=a.extendFlat,o=a.extendDeep;function l(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}e.exports=function(t,e){var r;t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var a,s=t.data,c=t.layout,u=o([],s),f=o({},c,l(e.tileClass)),d=t._context||{};if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var p=Object.keys(f);for(r=0;r<p.length;r++)a=p[r],["xaxis","yaxis","zaxis"].indexOf(a.slice(0,5))>-1&&(f[p[r]].title={text:""});for(r=0;r<u.length;r++){var h=u[r];h.showscale=!1,h.marker&&(h.marker.showscale=!1),n.traceIs(h,"pie-like")&&(h.textposition="none")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)f.annotations.push(e.annotations[r]);var g=Object.keys(f).filter((function(t){return t.match(/^scene\d*$/)}));if(g.length){var v={};for("thumbnail"===e.tileClass&&(v={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<g.length;r++){var m=f[g[r]];m.xaxis||(m.xaxis={}),m.yaxis||(m.yaxis={}),m.zaxis||(m.zaxis={}),i(m.xaxis,v),i(m.yaxis,v),i(m.zaxis,v),m._scene=null}}var y=document.createElement("div");e.tileClass&&(y.className=e.tileClass);var x={gd:y,td:y,layout:f,data:u,config:{staticPlot:void 0===e.staticPlot||e.staticPlot,plotGlPixelRatio:void 0===e.plotGlPixelRatio?2:e.plotGlPixelRatio,displaylogo:e.displaylogo||!1,showLink:e.showLink||!1,showTips:e.showTips||!1,mapboxAccessToken:d.mapboxAccessToken}};return"transparent"!==e.setBackground&&(x.config.setBackground=e.setBackground||"opaque"),x.gd.defaultLayout=l(e.tileClass),x}},{"../lib":233,"../registry":326}],328:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plot_api/to_image"),i=t("./filesaver"),o=t("./helpers");e.exports=function(t,e){var r;return n.isPlainObject(t)||(r=n.getGraphDiv(t)),(e=e||{}).format=e.format||"png",e.width=e.width||null,e.height=e.height||null,e.imageDataOnly=!0,new Promise((function(l,s){r&&r._snapshotInProgress&&s(new Error("Snapshotting already in progress.")),n.isIE()&&"svg"!==e.format&&s(new Error(o.MSG_IE_BAD_FORMAT)),r&&(r._snapshotInProgress=!0);var c=a(t,e),u=e.filename||t.fn||"newplot";u+="."+e.format.replace("-","."),c.then((function(t){return r&&(r._snapshotInProgress=!1),i(t,u,e.format)})).then((function(t){l(t)})).catch((function(t){r&&(r._snapshotInProgress=!1),s(t)}))}))}},{"../lib":233,"../plot_api/to_image":271,"./filesaver":329,"./helpers":330}],329:[function(t,e,r){"use strict";var n=t("../lib"),a=t("./helpers");e.exports=function(t,e,r){var i=document.createElement("a"),o="download"in i;return new Promise((function(l,s){var c,u;if(n.isIE9orBelow()&&s(new Error("IE < 10 unsupported")),n.isSafari()){var f="svg"===r?",":";base64,";return a.octetStream(f+encodeURIComponent(t)),l(e)}return n.isIE()?(c=a.createBlob(t,"svg"),window.navigator.msSaveBlob(c,e),c=null,l(e)):o?(c=a.createBlob(t,r),u=a.createObjectURL(c),i.href=u,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),a.revokeObjectURL(u),c=null,l(e)):void s(new Error("download error"))}))}},{"../lib":233,"./helpers":330}],330:[function(t,e,r){"use strict";var n=t("../registry");r.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("gl2d")||t._has("mapbox"))?500:0},r.getRedrawFunc=function(t){return function(){var e=t._fullLayout||{};!(e._has&&e._has("polar"))&&t.data&&t.data[0]&&t.data[0].r||n.getComponentMethod("colorbar","draw")(t)}},r.encodeSVG=function(t){return"data:image/svg+xml,"+encodeURIComponent(t)},r.encodeJSON=function(t){return"data:application/json,"+encodeURIComponent(t)};var a=window.URL||window.webkitURL;r.createObjectURL=function(t){return a.createObjectURL(t)},r.revokeObjectURL=function(t){return a.revokeObjectURL(t)},r.createBlob=function(t,e){if("svg"===e)return new window.Blob([t],{type:"image/svg+xml;charset=utf-8"});if("full-json"===e)return new window.Blob([t],{type:"application/json;charset=utf-8"});var r=function(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r),a=0;a<e;a++)n[a]=t.charCodeAt(a);return r}(window.atob(t));return new window.Blob([r],{type:"image/"+e})},r.octetStream=function(t){document.location.href="data:application/octet-stream"+t},r.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/,r.MSG_IE_BAD_FORMAT="Sorry IE does not support downloading from canvas. Try {format:'svg'} instead."},{"../registry":326}],331:[function(t,e,r){"use strict";var n=t("./helpers"),a={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:t("./cloneplot"),toSVG:t("./tosvg"),svgToImg:t("./svgtoimg"),toImage:t("./toimage"),downloadImage:t("./download")};e.exports=a},{"./cloneplot":327,"./download":328,"./helpers":330,"./svgtoimg":332,"./toimage":333,"./tosvg":334}],332:[function(t,e,r){"use strict";var n=t("../lib"),a=t("events").EventEmitter,i=t("./helpers");e.exports=function(t){var e=t.emitter||new a,r=new Promise((function(a,o){var l=window.Image,s=t.svg,c=t.format||"png";if(n.isIE()&&"svg"!==c){var u=new Error(i.MSG_IE_BAD_FORMAT);return o(u),t.promise?r:e.emit("error",u)}var f,d,p=t.canvas,h=t.scale||1,g=t.width||300,v=t.height||150,m=h*g,y=h*v,x=p.getContext("2d"),b=new l;"svg"===c||n.isIE9orBelow()||n.isSafari()?d=i.encodeSVG(s):(f=i.createBlob(s,"svg"),d=i.createObjectURL(f)),p.width=m,p.height=y,b.onload=function(){var r;switch(f=null,i.revokeObjectURL(d),"svg"!==c&&x.drawImage(b,0,0,m,y),c){case"jpeg":r=p.toDataURL("image/jpeg");break;case"png":r=p.toDataURL("image/png");break;case"webp":r=p.toDataURL("image/webp");break;case"svg":r=d;break;default:var n="Image format is not jpeg, png, svg or webp.";if(o(new Error(n)),!t.promise)return e.emit("error",n)}a(r),t.promise||e.emit("success",r)},b.onerror=function(r){if(f=null,i.revokeObjectURL(d),o(r),!t.promise)return e.emit("error",r)},b.src=d}));return t.promise?r:e}},{"../lib":233,"./helpers":330,events:17}],333:[function(t,e,r){"use strict";var n=t("events").EventEmitter,a=t("../registry"),i=t("../lib"),o=t("./helpers"),l=t("./cloneplot"),s=t("./tosvg"),c=t("./svgtoimg");e.exports=function(t,e){var r=new n,u=l(t,{format:"png"}),f=u.gd;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var d=o.getRedrawFunc(f);return a.call("plot",f,u.data,u.layout,u.config).then(d).then((function(){var t=o.getDelay(f._fullLayout);setTimeout((function(){var t=s(f),n=document.createElement("canvas");n.id=i.randstr(),(r=c({format:e.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:n,emitter:r,svg:t})).clean=function(){f&&document.body.removeChild(f)}}),t)})).catch((function(t){r.emit("error",t)})),r}},{"../lib":233,"../registry":326,"./cloneplot":327,"./helpers":330,"./svgtoimg":332,"./tosvg":334,events:17}],334:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib"),i=t("../components/drawing"),o=t("../components/color"),l=t("../constants/xmlns_namespaces"),s=/"/g,c=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var u,f=t._fullLayout,d=f._paper,p=f._toppaper,h=f.width,g=f.height;d.insert("rect",":first-child").call(i.setRect,0,0,h,g).call(o.fill,f.paper_bgcolor);var v=f._basePlotModules||[];for(u=0;u<v.length;u++){var m=v[u];m.toSVG&&m.toSVG(t)}if(p){var y=p.node().childNodes,x=Array.prototype.slice.call(y);for(u=0;u<x.length;u++){var b=x[u];b.childNodes.length&&d.node().appendChild(b)}}if(f._draggers&&f._draggers.remove(),d.node().style.background="",d.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each((function(){var t=n.select(this);if("hidden"!==this.style.visibility&&"none"!==this.style.display){t.style({visibility:null,display:null});var e=this.style.fontFamily;e&&-1!==e.indexOf('"')&&t.style("font-family",e.replace(s,"TOBESTRIPPED"))}else t.remove()})),f._gradientUrlQueryParts){var _=[];for(var w in f._gradientUrlQueryParts)_.push(w);_.length&&d.selectAll(_.join(",")).each((function(){var t=n.select(this),e=this.style.fill;e&&-1!==e.indexOf("url(")&&t.style("fill",e.replace(s,"TOBESTRIPPED"));var r=this.style.stroke;r&&-1!==r.indexOf("url(")&&t.style("stroke",r.replace(s,"TOBESTRIPPED"))}))}"pdf"!==e&&"eps"!==e||d.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),d.node().setAttributeNS(l.xmlns,"xmlns",l.svg),d.node().setAttributeNS(l.xmlns,"xmlns:xlink",l.xlink),"svg"===e&&r&&(d.attr("width",r*h),d.attr("height",r*g),d.attr("viewBox","0 0 "+h+" "+g));var T=(new window.XMLSerializer).serializeToString(d.node());return T=function(t){var e=n.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,(function(t){return"&lt;"===t?"&#60;":"&rt;"===t?"&#62;":-1!==t.indexOf("<")||-1!==t.indexOf(">")?"":e.html(t).text()}));return e.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")).replace(c,"'"),a.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":105,"../components/drawing":127,"../constants/xmlns_namespaces":213,"../lib":233,d3:21}],335:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;n.mergeArray(e.text,t,"tx"),n.mergeArray(e.hovertext,t,"htx");var a=e.marker;if(a){n.mergeArray(a.opacity,t,"mo",!0),n.mergeArray(a.color,t,"mc");var i=a.line;i&&(n.mergeArray(i.color,t,"mlc"),n.mergeArrayCastPositive(i.width,t,"mlw"))}}},{"../../lib":233}],336:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../plots/template_attributes").texttemplateAttrs,o=t("../../components/colorscale/attributes"),l=t("../../plots/font_attributes"),s=t("./constants"),c=t("../../lib/extend").extendFlat,u=l({editType:"calc",arrayOk:!0,colorEditType:"style"}),f=c({},n.marker.line.width,{dflt:0}),d=c({width:f,editType:"calc"},o("marker.line")),p=c({line:d,editType:"calc"},o("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"}});e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,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":112,"../../lib/extend":227,"../../plots/font_attributes":307,"../../plots/template_attributes":321,"../scatter/attributes":447,"./constants":338}],337:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../plots/cartesian/align_period"),i=t("../../components/colorscale/helpers").hasColorscale,o=t("../../components/colorscale/calc"),l=t("./arrays_to_calcdata"),s=t("../scatter/calc_selection");e.exports=function(t,e){var r,c,u,f,d=n.getFromId(t,e.xaxis||"x"),p=n.getFromId(t,e.yaxis||"y"),h={msUTC:!(!e.base&&0!==e.base)};"h"===e.orientation?(r=d.makeCalcdata(e,"x",h),u=p.makeCalcdata(e,"y"),c=a(e,p,"y",u),f=!!e.yperiodalignment):(r=p.makeCalcdata(e,"y",h),u=d.makeCalcdata(e,"x"),c=a(e,d,"x",u),f=!!e.xperiodalignment);for(var g=Math.min(c.length,r.length),v=new Array(g),m=0;m<g;m++)v[m]={p:c[m],s:r[m]},f&&(v[m].orig_p=u[m]),e.ids&&(v[m].id=String(e.ids[m]));return i(e,"marker")&&o(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),i(e,"marker.line")&&o(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}),l(v,e),s(v,e),v}},{"../../components/colorscale/calc":113,"../../components/colorscale/helpers":116,"../../plots/cartesian/align_period":276,"../../plots/cartesian/axes":279,"../scatter/calc_selection":449,"./arrays_to_calcdata":335}],338:[function(t,e,r){"use strict";e.exports={TEXTPAD:3,eventDataKeys:["value","label"]}},{}],339:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib").isArrayOrTypedArray,i=t("../../constants/numerical").BADNUM,o=t("../../registry"),l=t("../../plots/cartesian/axes"),s=t("../../plots/cartesian/constraints").getAxisGroup,c=t("./sieve.js");function u(t,e,r,o,u){if(o.length){var b,_,w,T;switch(function(t,e){var r,i;for(r=0;r<e.length;r++){var o,l=e[r],s=l[0].trace,c="funnel"===s.type?s._base:s.base,u="h"===s.orientation?s.xcalendar:s.ycalendar,f="category"===t.type||"multicategory"===t.type?function(){return null}:t.d2c;if(a(c)){for(i=0;i<Math.min(c.length,l.length);i++)o=f(c[i],0,u),n(o)?(l[i].b=+o,l[i].hasB=1):l[i].b=0;for(;i<l.length;i++)l[i].b=0}else{o=f(c,0,u);var d=n(o);for(o=d?o:0,i=0;i<l.length;i++)l[i].b=o,d&&(l[i].hasB=1)}}}(r,o),u.mode){case"overlay":f(e,r,o,u);break;case"group":for(b=[],_=[],w=0;w<o.length;w++)void 0===(T=o[w])[0].trace.offset?_.push(T):b.push(T);_.length&&function(t,e,r,n,a){var o=new c(n,{sepNegVal:!1,overlapNoMerge:!a.norm});(function(t,e,r,n){for(var a=t._fullLayout,i=r.positions,o=r.distinctPositions,l=r.minDiff,c=r.traces,u=c.length,f=i.length!==o.length,d=l*(1-n.gap),v=s(a,e._id)+c[0][0].trace.orientation,m=a._alignmentOpts[v]||{},y=0;y<u;y++){var x,b,_=c[y],w=_[0].trace,T=m[w.alignmentgroup]||{},k=Object.keys(T.offsetGroups||{}).length,M=(x=k?d/k:f?d/u:d)*(1-(n.groupgap||0));b=k?((2*w._offsetIndex+1-k)*x-M)/2:f?((2*y+1-u)*x-M)/2:-M/2;var A=_[0].t;A.barwidth=M,A.poffset=b,A.bargroupwidth=d,A.bardelta=l}r.binWidth=c[0][0].t.barwidth/100,p(r),h(e,r),g(e,r,f)})(t,e,o,a),function(t){for(var e=t.traces,r=0;r<e.length;r++){var n=e[r];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)}(t,e,r,_,u),b.length&&f(e,r,b,u);break;case"stack":case"relative":for(b=[],_=[],w=0;w<o.length;w++)void 0===(T=o[w])[0].trace.base?_.push(T):b.push(T);_.length&&function(t,e,r,n,a){var o=new c(n,{sepNegVal:"relative"===a.mode,overlapNoMerge:!(a.norm||"stack"===a.mode||"relative"===a.mode)});d(e,o,a),function(t,e,r){var n,a,o,s,c,u,f=x(t),d=e.traces;for(s=0;s<d.length;s++)if(n=d[s],"funnel"===(a=n[0].trace).type)for(c=0;c<n.length;c++)(u=n[c]).s!==i&&e.put(u.p,-.5*u.s);for(s=0;s<d.length;s++){n=d[s],a=n[0].trace,o="funnel"===a.type;var p=[];for(c=0;c<n.length;c++)if((u=n[c]).s!==i){var h;h=o?u.s:u.s+u.b;var g=e.put(u.p,h),v=g+h;u.b=g,u[f]=v,r.norm||(p.push(v),u.hasB&&p.push(g))}r.norm||(a._extremes[t._id]=l.findExtremes(t,p,{tozero:!0,padded:!0}))}}(r,o,a);for(var s=0;s<n.length;s++)for(var u=n[s],f=0;f<u.length;f++){var p=u[f];if(p.s!==i)p.b+p.s===o.get(p.p,p.s)&&(p._outmost=!0)}a.norm&&y(r,o,a)}(0,e,r,_,u),b.length&&f(e,r,b,u)}!function(t,e){var r,a,i,o=x(e),l={},s=1/0,c=-1/0;for(r=0;r<t.length;r++)for(i=t[r],a=0;a<i.length;a++){var u=i[a].p;n(u)&&(s=Math.min(s,u),c=Math.max(c,u))}var f=1e4/(c-s),d=l.round=function(t){return String(Math.round(f*(t-s)))};for(r=0;r<t.length;r++){(i=t[r])[0].t.extents=l;var p=i[0].t.poffset,h=Array.isArray(p);for(a=0;a<i.length;a++){var g=i[a],v=g[o]-g.w/2;if(n(v)){var m=g[o]+g.w/2,y=d(g.p);l[y]?l[y]=[Math.min(v,l[y][0]),Math.max(m,l[y][1])]:l[y]=[v,m]}g.p0=g.p+(h?p[a]:p),g.p1=g.p0+g.w,g.s0=g.b,g.s1=g.s0+g.s}}}(o,e)}}function f(t,e,r,n){for(var a=0;a<r.length;a++){var i=r[a],o=new c([i],{unitMinDiff:n.xCat||n.yCat,sepNegVal:!1,overlapNoMerge:!n.norm});d(t,o,n),n.norm?(m(o),y(e,o,n)):v(e,o)}}function d(t,e,r){for(var n=e.minDiff,a=e.traces,i=n*(1-r.gap),o=i*(1-(r.groupgap||0)),l=-o/2,s=0;s<a.length;s++){var c=a[s][0].t;c.barwidth=o,c.poffset=l,c.bargroupwidth=i,c.bardelta=n}e.binWidth=a[0][0].t.barwidth/100,p(e),h(t,e),g(t,e)}function p(t){var e,r,i=t.traces;for(e=0;e<i.length;e++){var o,l=i[e],s=l[0],c=s.trace,u=s.t,f=c._offset||c.offset,d=u.poffset;if(a(f)){for(o=Array.prototype.slice.call(f,0,l.length),r=0;r<o.length;r++)n(o[r])||(o[r]=d);for(r=o.length;r<l.length;r++)o.push(d);u.poffset=o}else void 0!==f&&(u.poffset=f);var p=c._width||c.width,h=u.barwidth;if(a(p)){var g=Array.prototype.slice.call(p,0,l.length);for(r=0;r<g.length;r++)n(g[r])||(g[r]=h);for(r=g.length;r<l.length;r++)g.push(h);if(u.barwidth=g,void 0===f){for(o=[],r=0;r<l.length;r++)o.push(d+(h-g[r])/2);u.poffset=o}}else void 0!==p&&(u.barwidth=p,void 0===f&&(u.poffset=d+(h-p)/2))}}function h(t,e){for(var r=e.traces,n=x(t),a=0;a<r.length;a++)for(var i=r[a],o=i[0].t,l=o.poffset,s=Array.isArray(l),c=o.barwidth,u=Array.isArray(c),f=0;f<i.length;f++){var d=i[f],p=d.w=u?c[f]:c;d[n]=d.p+(s?l[f]:l)+p/2}}function g(t,e,r){var n=e.traces,a=e.minDiff/2;l.minDtick(t,e.minDiff,e.distinctPositions[0],r);for(var i=0;i<n.length;i++){var o,s,c,u,f=n[i],d=f[0],p=d.trace,h=[];for(u=0;u<f.length;u++)s=(o=f[u]).p-a,c=o.p+a,h.push(s,c);if(p.width||p.offset){var g=d.t,v=g.poffset,m=g.barwidth,y=Array.isArray(v),x=Array.isArray(m);for(u=0;u<f.length;u++){o=f[u];var b=y?v[u]:v,_=x?m[u]:m;c=(s=o.p+b)+_,h.push(s,c)}}p._extremes[t._id]=l.findExtremes(t,h,{padded:!1})}}function v(t,e){for(var r=e.traces,n=x(t),a=0;a<r.length;a++){for(var i=r[a],o=i[0].trace,s=[],c=!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[t._id]=l.findExtremes(t,s,{tozero:c,padded:!0})}}function m(t){for(var e=t.traces,r=0;r<e.length;r++)for(var n=e[r],a=0;a<n.length;a++){var o=n[a];o.s!==i&&t.put(o.p,o.b+o.s)}}function y(t,e,r){var a=e.traces,o=x(t),s="fraction"===r.norm?1:100,c=s/1e9,u=t.l2c(t.c2l(0)),f="stack"===r.mode?s:u;function d(e){return n(t.c2l(e))&&(e<u-c||e>f+c||!n(u))}for(var p=0;p<a.length;p++){for(var h=a[p],g=h[0].trace,v=[],m=!1,y=!1,b=0;b<h.length;b++){var _=h[b];if(_.s!==i){var w=Math.abs(s/e.get(_.p,_.s));_.b*=w,_.s*=w;var T=_.b,k=T+_.s;_[o]=k,v.push(k),y=y||d(k),_.hasB&&(v.push(T),y=y||d(T)),_.hasB&&_.b||(m=!0)}}g._extremes[t._id]=l.findExtremes(t,v,{tozero:m,padded:y})}}function x(t){return t._id.charAt(0)}e.exports={crossTraceCalc:function(t,e){for(var r=e.xaxis,n=e.yaxis,a=t._fullLayout,i=t._fullData,l=t.calcdata,s=[],c=[],f=0;f<i.length;f++){var d=i[f];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=t.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={xCat:"category"===r.type||"multicategory"===r.type,yCat:"category"===n.type||"multicategory"===n.type,mode:a.barmode,norm:a.barnorm,gap:a.bargap,groupgap:a.bargroupgap};u(t,r,n,c,g),u(t,n,r,s,g)},setGroupPositions:u}},{"../../constants/numerical":212,"../../lib":233,"../../plots/cartesian/axes":279,"../../plots/cartesian/constraints":286,"../../registry":326,"./sieve.js":349,"fast-isnumeric":23}],340:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),i=t("../../registry"),o=t("../scatter/xy_defaults"),l=t("../scatter/period_defaults"),s=t("./style_defaults"),c=t("../../plots/cartesian/constraints").getAxisGroup,u=t("./attributes"),f=n.coerceFont;function d(t,e,r,n){var a=e.orientation,i=e[{v:"x",h:"y"}[a]+"axis"],o=c(r,i)+a,l=r._alignmentOpts||{},s=n("alignmentgroup"),u=l[o];u||(u=l[o]={});var f=u[s];f?f.traces.push(e):f=u[s]={traces:[e],alignmentIndex:Object.keys(u).length,offsetGroups:{}};var d=n("offsetgroup"),p=f.offsetGroups,h=p[d];d&&(h||(h=p[d]={offsetIndex:Object.keys(p).length}),e._offsetIndex=h.offsetIndex)}function p(t,e,r,a,i,o){var l=!(!1===(o=o||{}).moduleHasSelected),s=!(!1===o.moduleHasUnselected),c=!(!1===o.moduleHasConstrain),u=!(!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=f(a,"textfont",r.font),x=n.extendFlat({},y),b=!(t.textfont&&t.textfont.color);if(b&&delete x.color,f(a,"insidetextfont",x),h){var _=n.extendFlat({},y);b&&delete _.color,f(a,"pathbar.textfont",_)}m&&f(a,"outsidetextfont",y),l&&a("selected.textfont.color"),s&&a("unselected.textfont.color"),c&&a("constraintext"),u&&a("cliponaxis"),d&&a("textangle"),a("texttemplate")}v&&p&&a("insidetextanchor")}e.exports={supplyDefaults:function(t,e,r,c){function f(r,a){return n.coerce(t,e,u,r,a)}if(o(t,e,c,f)){l(t,e,c,f),f("orientation",e.x&&!e.y?"h":"v"),f("base"),f("offset"),f("width"),f("text"),f("hovertext"),f("hovertemplate");var d=f("textposition");p(t,e,c,f,d,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),s(t,e,f,r,c);var h=(e.marker.line||{}).color,g=i.getComponentMethod("errorbars","supplyDefaults");g(t,e,h||a.defaultLine,{axis:"y"}),g(t,e,h||a.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1},crossTraceDefaults:function(t,e){var r;function a(t){return n.coerce(r._input,r,u,t)}if("group"===e.barmode)for(var i=0;i<t.length;i++)"bar"===(r=t[i]).type&&(r._input,d(0,r,e,a))},handleGroupingDefaults:d,handleText:p}},{"../../components/color":105,"../../lib":233,"../../plots/cartesian/constraints":286,"../../registry":326,"../scatter/period_defaults":467,"../scatter/xy_defaults":474,"./attributes":336,"./style_defaults":351}],341:[function(t,e,r){"use strict";e.exports=function(t,e,r){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),"h"===r.orientation?(t.label=t.y,t.value=t.x):(t.label=t.x,t.value=t.y),t}},{}],342:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../../lib").isArrayOrTypedArray;r.coerceString=function(t,e,r){if("string"==typeof e){if(e||!t.noBlank)return e}else if(("number"==typeof e||!0===e)&&!t.strict)return String(e);return void 0!==r?r:t.dflt},r.coerceNumber=function(t,e,r){if(n(e)){e=+e;var a=t.min,i=t.max;if(!(void 0!==a&&e<a||void 0!==i&&e>i))return e}return void 0!==r?r:t.dflt},r.coerceColor=function(t,e,r){return a(e).isValid()?e:void 0!==r?r:t.dflt},r.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt},r.getValue=function(t,e){var r;return Array.isArray(t)?e<t.length&&(r=t[e]):r=t,r},r.getLineWidth=function(t,e){return 0<e.mlw?e.mlw:i(t.marker.line.width)?0:t.marker.line.width}},{"../../lib":233,"fast-isnumeric":23,tinycolor2:88}],343:[function(t,e,r){"use strict";var n=t("../../components/fx"),a=t("../../registry"),i=t("../../components/color"),o=t("../../lib").fillText,l=t("./helpers").getLineWidth,s=t("../../plots/cartesian/axes").hoverLabelText,c=t("../../constants/numerical").BADNUM;function u(t,e,r,a){var i,l,u,f,d,p,h,g=t.cd,v=g[0].trace,m=g[0].t,y="closest"===a,x="waterfall"===v.type,b=t.maxHoverDistance;function _(t){return t[u]-t.w/2}function w(t){return t[u]+t.w/2}var T=y?_:function(t){return Math.min(_(t),t.p-m.bardelta/2)},k=y?w:function(t){return Math.max(w(t),t.p+m.bardelta/2)};function M(t,e){return n.inbox(t-i,e-i,b+Math.min(1,Math.abs(e-t)/h)-1)}function A(t){return M(T(t),k(t))}function L(t){var e=l,r=t.b,a=t[f];if(x){var i=Math.abs(t.rawS)||0;e>0?a+=i:e<0&&(a-=i)}return n.inbox(r-e,a-e,b+(a-e)/(a-r)-1)}"h"===v.orientation?(i=r,l=e,u="y",f="x",d=L,p=A):(i=e,l=r,u="x",f="y",p=L,d=A);var S=t[u+"a"],C=t[f+"a"];h=Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0]));var O=n.getDistanceFunction(a,d,p,(function(t){return(d(t)+p(t))/2}));if(n.getClosest(g,O,t),!1!==t.index&&g[t.index].p!==c){y||(T=function(t){return Math.min(_(t),t.p-m.bargroupwidth/2)},k=function(t){return Math.max(w(t),t.p+m.bargroupwidth/2)});var D=g[t.index],z=v.base?D.b+D.s:D.s;t[f+"0"]=t[f+"1"]=C.c2p(D[f],!0),t[f+"LabelVal"]=z;var P=m.extents[m.extents.round(D.p)];t[u+"0"]=S.c2p(y?T(D):P[0],!0),t[u+"1"]=S.c2p(y?k(D):P[1],!0);var E=void 0!==D.orig_p;return t[u+"LabelVal"]=E?D.orig_p:D.p,t.labelLabel=s(S,t[u+"LabelVal"]),t.valueLabel=s(C,t[f+"LabelVal"]),t.baseLabel=s(C,D.b),t.spikeDistance=(L(D)+function(t){return M(_(t),w(t))}(D))/2-b,t[u+"Spike"]=S.c2p(D.p,!0),o(D,v,t),t.hovertemplate=v.hovertemplate,t}}function f(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,a=l(t,e);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}e.exports={hoverPoints:function(t,e,r,n){var i=u(t,e,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":105,"../../components/fx":145,"../../constants/numerical":212,"../../lib":233,"../../plots/cartesian/axes":279,"../../registry":326,"./helpers":342}],344:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc").crossTraceCalc,colorbar:t("../scatter/marker_colorbar"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"bar",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":292,"../scatter/marker_colorbar":465,"./arrays_to_calcdata":335,"./attributes":336,"./calc":337,"./cross_trace_calc":339,"./defaults":340,"./event_data":341,"./hover":343,"./layout_attributes":345,"./layout_defaults":346,"./plot":347,"./select":348,"./style":350}],345:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],346:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/cartesian/axes"),i=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function l(r,n){return i.coerce(t,e,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=l("barmode"),p=0;p<r.length;p++){var h=r[p];if(n.traceIs(h,"bar")&&h.visible){if(s=!0,"group"===d){var g=h.xaxis+h.yaxis;f[g]&&(u=!0),f[g]=!0}if(h.visible&&"histogram"===h.type)"category"!==a.getFromId({_fullLayout:e},h["v"===h.orientation?"xaxis":"yaxis"]).type&&(c=!0)}}s?("overlay"!==d&&l("barnorm"),l("bargap",c&&!u?0:.2),l("bargroupgap")):delete e.barmode}},{"../../lib":233,"../../plots/cartesian/axes":279,"../../registry":326,"./layout_attributes":345}],347:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../lib/svg_text_utils"),l=t("../../components/color"),s=t("../../components/drawing"),c=t("../../registry"),u=t("../../plots/cartesian/axes").tickText,f=t("./uniform_text"),d=f.recordMinTextSize,p=f.clearMinTextSize,h=t("./style"),g=t("./helpers"),v=t("./constants"),m=t("./attributes"),y=m.text,x=m.textposition,b=t("../../components/fx/helpers").appendArrayPointValue,_=v.TEXTPAD;function w(t){return t.id}function T(t){if(t.ids)return w}function k(t,e){return t<e?1:-1}function M(t,e,r,n){var a;return!e.uniformtext.mode&&A(r)?(n&&(a=n()),t.transition().duration(r.duration).ease(r.easing).each("end",(function(){a&&a()})).each("interrupt",(function(){a&&a()}))):t}function A(t){return t&&t.duration>0}function L(t){return"auto"===t?0:t}function S(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:t.width*a+t.height*n,y:t.width*n+t.height*a}}function C(t,e,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,f="start"===c,d=((i.leftToRight||0)+1)/2,p=1-d,h=a.width,g=a.height,v=Math.abs(e-t),m=Math.abs(n-r),y=v>2*_&&m>2*_?_:0;v-=2*y,m-=2*y;var x=L(s);"auto"!==s||h<=v&&g<=m||!(h>v||g>m)||(h>m||g>v)&&h<g==v<m||(x+=90);var b=S(a,x),w=1;l&&(w=Math.min(1,v/b.x,m/b.y));var T=a.left*p+a.right*d,M=(a.top+a.bottom)/2,A=(t+_)*p+(e-_)*d,C=(r+n)/2,O=0,D=0;if(f||u){var z=(o?b.x:b.y)/2,P=o?k(t,e):k(r,n);o?f?(A=t+P*y,O=-P*z):(A=e-P*y,O=P*z):f?(C=r+P*y,D=-P*z):(C=n-P*y,D=P*z)}return{textX:T,textY:M,targetX:A,targetY:C,anchorX:O,anchorY:D,scale:w,rotate:x}}e.exports={plot:function(t,e,r,f,v,m){var w=e.xaxis,O=e.yaxis,D=t._fullLayout;v||(v={mode:D.barmode,norm:D.barmode,gap:D.bargap,groupgap:D.bargroupgap},p("bar",D));var z=i.makeTraceGroups(f,r,"trace bars").each((function(r){var c=n.select(this),f=r[0].trace,p="waterfall"===f.type,z="funnel"===f.type,P="bar"===f.type||z,E=0;p&&f.connector.visible&&"between"===f.connector.mode&&(E=f.connector.line.width/2);var I="h"===f.orientation,R=A(v),F=i.ensureSingle(c,"g","points"),N=T(f),B=F.selectAll("g.point").data(i.identity,N);B.enter().append("g").classed("point",!0),B.exit().remove(),B.each((function(c,p){var T,A,z=n.select(this),F=function(t,e,r,n){var a=[],i=[],o=n?e:r,l=n?r:e;return a[0]=o.c2p(t.s0,!0),i[0]=l.c2p(t.p0,!0),a[1]=o.c2p(t.s1,!0),i[1]=l.c2p(t.p1,!0),n?[a,i]:[i,a]}(c,w,O,I),N=F[0][0],B=F[0][1],H=F[1][0],j=F[1][1],U=0==(I?B-N:j-H);if(U&&P&&g.getLineWidth(f,c)&&(U=!1),U||(U=!(a(N)&&a(B)&&a(H)&&a(j))),c.isBlank=U,U&&(I?B=N:j=H),E&&!U&&(I?(N-=k(N,B)*E,B+=k(N,B)*E):(H-=k(H,j)*E,j+=k(H,j)*E)),"waterfall"===f.type){if(!U){var V=f[c.dir].marker;T=V.line.width,A=V.color}}else T=g.getLineWidth(f,c),A=c.mc||f.marker.color;function q(t){var e=n.round(T/2%1,2);return 0===v.gap&&0===v.groupgap?n.round(Math.round(t)-e,2):t}if(!t._context.staticPlot){var G=l.opacity(A)<1||T>.01?q:function(t,e,r){return r&&t===e?t:Math.abs(t-e)>=2?q(t):t>e?Math.ceil(t):Math.floor(t)};N=G(N,B,I),B=G(B,N,I),H=G(H,j,!I),j=G(j,H,!I)}var Z=M(i.ensureSingle(z,"path"),D,v,m);if(Z.style("vector-effect","non-scaling-stroke").attr("d",isNaN((B-N)*(j-H))||U&&t._context.staticPlot?"M0,0Z":"M"+N+","+H+"V"+j+"H"+B+"V"+H+"Z").call(s.setClipUrl,e.layerClipId,t),!D.uniformtext.mode&&R){var Y=s.makePointStyleFns(f);s.singlePointStyle(c,Z,f,Y,t)}!function(t,e,r,n,a,l,c,f,p,v,m){var w,T=e.xaxis,A=e.yaxis,O=t._fullLayout;function D(e,r,n){return i.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,t)}var z=n[0].trace,P="h"===z.orientation,E=function(t,e,r,n,a){var o,l=e[0].trace;o=l.texttemplate?function(t,e,r,n,a){var o=e[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,f,d,p="waterfall"===o.type,h="funnel"===o.type;"h"===o.orientation?(s="y",c=a,f="x",d=n):(s="x",c=n,f="y",d=a);function g(t){return u(d,+t,!0).text}var v=e[r],m={};m.label=v.p,m.labelLabel=m[s+"Label"]=(y=v.p,u(c,y,!0).text);var y;var x=i.castOption(o,v.i,"text");(0===x||x)&&(m.text=x);m.value=v.s,m.valueLabel=m[f+"Label"]=g(v.s);var _={};b(_,o,v.i),p&&(m.delta=+v.rawS||v.s,m.deltaLabel=g(m.delta),m.final=v.v,m.finalLabel=g(m.final),m.initial=m.final-m.delta,m.initialLabel=g(m.initial));h&&(m.value=v.s,m.valueLabel=g(m.value),m.percentInitial=v.begR,m.percentInitialLabel=i.formatPercent(v.begR),m.percentPrevious=v.difR,m.percentPreviousLabel=i.formatPercent(v.difR),m.percentTotal=v.sumR,m.percenTotalLabel=i.formatPercent(v.sumR));var w=i.castOption(o,v.i,"customdata");w&&(m.customdata=w);return i.texttemplateString(l,m,t._d3locale,_,m,o._meta||{})}(t,e,r,n,a):l.textinfo?function(t,e,r,n){var a=t[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(t){return u(o?r:n,+t,!0).text}var f,d=a.textinfo,p=t[e],h=d.split("+"),g=[],v=function(t){return-1!==h.indexOf(t)};v("label")&&g.push((m=t[e].p,u(o?n:r,m,!0).text));var m;v("text")&&(0===(f=i.castOption(a,p.i,"text"))||f)&&g.push(f);if(l){var y=+p.rawS||p.s,x=p.v,b=x-y;v("initial")&&g.push(c(b)),v("delta")&&g.push(c(y)),v("final")&&g.push(c(x))}if(s){v("value")&&g.push(c(p.s));var _=0;v("percent initial")&&_++,v("percent previous")&&_++,v("percent total")&&_++;var w=_>1;v("percent initial")&&(f=i.formatPercent(p.begR),w&&(f+=" of initial"),g.push(f)),v("percent previous")&&(f=i.formatPercent(p.difR),w&&(f+=" of previous"),g.push(f)),v("percent total")&&(f=i.formatPercent(p.sumR),w&&(f+=" of total"),g.push(f))}return g.join("<br>")}(e,r,n,a):g.getValue(l.text,r);return g.coerceString(y,o)}(O,n,a,T,A);w=function(t,e){var r=g.getValue(t.textposition,e);return g.coerceEnumerated(x,r)}(z,a);var I="stack"===v.mode||"relative"===v.mode,R=n[a],F=!I||R._outmost;if(!E||"none"===w||(R.isBlank||l===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var N=O.font,B=h.getBarColor(n[a],z),H=h.getInsideTextFont(z,a,N,B),j=h.getOutsideTextFont(z,a,N),U=r.datum();P?"log"===T.type&&U.s0<=0&&(l=T.range[0]<T.range[1]?0:T._length):"log"===A.type&&U.s0<=0&&(f=A.range[0]<A.range[1]?A._length:0);var V,q,G,Z,Y,X=Math.abs(c-l)-2*_,W=Math.abs(p-f)-2*_;"outside"===w&&(F||R.hasB||(w="inside"));if("auto"===w)if(F){w="inside",Y=i.ensureUniformFontSize(t,H),V=D(r,E,Y),q=s.bBox(V.node()),G=q.width,Z=q.height;var Q=G<=X&&Z<=W,J=G<=W&&Z<=X,$=P?X>=G*(W/Z):W>=Z*(X/G);G>0&&Z>0&&(Q||J||$)?w="inside":(w="outside",V.remove(),V=null)}else w="inside";if(!V){Y=i.ensureUniformFontSize(t,"outside"===w?j:H);var K=(V=D(r,E,Y)).attr("transform");if(V.attr("transform",""),q=s.bBox(V.node()),G=q.width,Z=q.height,V.attr("transform",K),G<=0||Z<=0)return void V.remove()}var tt,et,rt=z.textangle;"outside"===w?(et="both"===z.constraintext||"outside"===z.constraintext,tt=function(t,e,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,f=a.height,d=Math.abs(e-t),p=Math.abs(n-r);o=l?p>2*_?_:0:d>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/f):Math.min(1,d/u));var g=L(c),v=S(a,g),m=(l?v.x:v.y)/2,y=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(t+e)/2,w=(r+n)/2,T=0,M=0,A=l?k(e,t):k(r,n);l?(b=e-A*o,T=A*m):(w=n+A*o,M=-A*m);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:M,scale:h,rotate:g}}(l,c,f,p,q,{isHorizontal:P,constrained:et,angle:rt})):(et="both"===z.constraintext||"inside"===z.constraintext,tt=C(l,c,f,p,q,{isHorizontal:P,constrained:et,angle:rt,anchor:z.insidetextanchor}));tt.fontSize=Y.size,d(z.type,tt,O),R.transform=tt,M(V,O,v,m).attr("transform",i.getTextTransform(tt))}(t,e,z,r,p,N,B,H,j,v,m),e.layerClipId&&s.hideOutsideRangePoint(c,z.select("text"),w,O,f.xcalendar,f.ycalendar)}));var H=!1===f.cliponaxis;s.setClipUrl(c,H?null:e.layerClipId,t)}));c.getComponentMethod("errorbars","plot")(t,z,e,v)},toMoveInsideBar:C}},{"../../components/color":105,"../../components/drawing":127,"../../components/fx/helpers":141,"../../lib":233,"../../lib/svg_text_utils":255,"../../plots/cartesian/axes":279,"../../registry":326,"./attributes":336,"./constants":338,"./helpers":342,"./style":350,"./uniform_text":352,d3:21,"fast-isnumeric":23}],348:[function(t,e,r){"use strict";function n(t,e,r,n,a){var i=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),l=r.c2p(n?t.p0:t.s0,!0),s=r.c2p(n?t.p1:t.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}e.exports=function(t,e){var r,a=t.cd,i=t.xaxis,o=t.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===e)for(r=0;r<a.length;r++)a[r].selected=0;else for(r=0;r<a.length;r++){var f=a[r],d="ct"in f?f.ct:n(f,i,o,c,s);e.contains(d,!1,r,t)?(u.push({pointNumber:r,x:i.c2d(f.x),y:o.c2d(f.y)}),f.selected=1):f.selected=0}return u}},{}],349:[function(t,e,r){"use strict";e.exports=i;var n=t("../../lib").distinctVals,a=t("../../constants/numerical").BADNUM;function i(t,e){this.traces=t,this.sepNegVal=e.sepNegVal,this.overlapNoMerge=e.overlapNoMerge;for(var r=1/0,i=[],o=0;o<t.length;o++){for(var l=t[o],s=0;s<l.length;s++){var c=l[s];c.p!==a&&i.push(c.p)}l[0]&&l[0].width1&&(r=Math.min(l[0].width1,r))}this.positions=i;var u=n(i,{unitMinDiff:e.unitMinDiff});this.distinctPositions=u.vals,1===u.vals.length&&r!==1/0?this.minDiff=r:this.minDiff=Math.min(u.minDiff,r),this.binWidth=this.minDiff,this.bins={}}i.prototype.put=function(t,e){var r=this.getLabel(t,e),n=this.bins[r]||0;return this.bins[r]=n+e,n},i.prototype.get=function(t,e){var r=this.getLabel(t,e);return this.bins[r]||0},i.prototype.getLabel=function(t,e){return(e<0&&this.sepNegVal?"v":"^")+(this.overlapNoMerge?t:Math.round(t/this.binWidth))}},{"../../constants/numerical":212,"../../lib":233}],350:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/color"),i=t("../../components/drawing"),o=t("../../lib"),l=t("../../registry"),s=t("./uniform_text").resizeText,c=t("./attributes"),u=c.textfont,f=c.insidetextfont,d=c.outsidetextfont,p=t("./helpers");function h(t,e,r){i.pointStyle(t.selectAll("path"),e,r),g(t,e,r)}function g(t,e,r){t.selectAll("text").each((function(t){var a=n.select(this),l=o.ensureUniformFontSize(r,v(a,t,e,r));i.font(a,l)}))}function v(t,e,r,n){var a=n._fullLayout.font,i=r.textfont;if(t.classed("bartext-inside")){var o=_(e,r);i=y(r,e.i,a,o)}else t.classed("bartext-outside")&&(i=x(r,e.i,a));return i}function m(t,e,r){return b(u,t.textfont,e,r)}function y(t,e,r,n){var i=m(t,e,r);return(void 0===t._input.textfont||void 0===t._input.textfont.color||Array.isArray(t.textfont.color)&&void 0===t.textfont.color[e])&&(i={color:a.contrast(n),family:i.family,size:i.size}),b(f,t.insidetextfont,e,i)}function x(t,e,r){var n=m(t,e,r);return b(d,t.outsidetextfont,e,n)}function b(t,e,r,n){e=e||{};var a=p.getValue(e.family,r),i=p.getValue(e.size,r),o=p.getValue(e.color,r);return{family:p.coerceString(t.family,a,n.family),size:p.coerceNumber(t.size,i,n.size),color:p.coerceColor(t.color,o,n.color)}}function _(t,e){return"waterfall"===e.type?e[t.dir].marker.color:t.mc||e.marker.color}e.exports={style:function(t){var e=n.select(t).selectAll("g.barlayer").selectAll("g.trace");s(t,e,"bar");var r=e.size(),a=t._fullLayout;e.style("opacity",(function(t){return t[0].trace.opacity})).each((function(t){("stack"===a.barmode&&r>1||0===a.bargap&&0===a.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),e.selectAll("g.points").each((function(e){h(n.select(this),e[0].trace,t)})),l.getComponentMethod("errorbars","style")(e)},styleTextPoints:g,styleOnSelect:function(t,e,r){var a=e[0].trace;a.selectedpoints?function(t,e,r){i.selectedPointStyle(t.selectAll("path"),e),function(t,e,r){t.each((function(t){var a,l=n.select(this);if(t.selected){a=o.ensureUniformFontSize(r,v(l,t,e,r));var s=e.selected.textfont&&e.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,e)}))}(t.selectAll("text"),e,r)}(r,a,t):(h(r,a,t),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":105,"../../components/drawing":127,"../../lib":233,"../../registry":326,"./attributes":336,"./helpers":342,"./uniform_text":352,d3:21}],351:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,l){r("marker.color",o),a(t,"marker")&&i(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&i(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":105,"../../components/colorscale/defaults":115,"../../components/colorscale/helpers":116}],352:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib");function i(t){return"_"+t+"Text_minsize"}e.exports={recordMinTextSize:function(t,e,r){if(r.uniformtext.mode){var n=i(t),a=r.uniformtext.minsize,o=e.scale*e.fontSize;e.hide=o<a,r[n]=r[n]||1/0,e.hide||(r[n]=Math.min(r[n],Math.max(o,a)))}},clearMinTextSize:function(t,e){e[i(t)]=void 0},resizeText:function(t,e,r){var i=t._fullLayout,o=i["_"+r+"Text_minsize"];if(o){var l,s="hide"===i.uniformtext.mode;switch(r){case"funnelarea":case"pie":case"sunburst":l="g.slice";break;case"treemap":l="g.slice, g.pathbar";break;default:l="g.points > g.point"}e.selectAll(l).each((function(t){var e=t.transform;e&&(e.scale=s&&e.hide?0:o/e.fontSize,n.select(this).select("text").attr("transform",a.getTextTransform(e)))}))}}}},{"../../lib":233,d3:21}],353:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../bar/attributes"),i=t("../../components/color/attributes"),o=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../lib/extend").extendFlat,s=n.marker,c=s.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:l({},s.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},s.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:l({},s.size,{arrayOk:!1,editType:"calc"}),color:l({},s.color,{arrayOk:!1,editType:"style"}),line:{color:l({},c.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:l({},c.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},offsetgroup:a.offsetgroup,alignmentgroup:a.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),hovertemplate:o({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":104,"../../lib/extend":227,"../../plots/template_attributes":321,"../bar/attributes":336,"../scatter/attributes":447}],354:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),i=t("../../plots/cartesian/align_period"),o=t("../../lib"),l=t("../../constants/numerical").BADNUM,s=o._;e.exports=function(t,e){var r,c,y,x,b,_,w,T=t._fullLayout,k=a.getFromId(t,e.xaxis||"x"),M=a.getFromId(t,e.yaxis||"y"),A=[],L="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(y=k,x="x",b=M,_="y",w=!!e.yperiodalignment):(y=M,x="y",b=k,_="x",w=!!e.xperiodalignment);var S,C,O,D,z,P,E=function(t,e,r,a){var l,s=e+"0"in t,c="d"+e in t;if(e in t||s&&c){var u=r.makeCalcdata(t,e);return[i(t,r,e,u),u]}l=s?t[e+"0"]:"name"in t&&("category"===r.type||n(t.name)&&-1!==["linear","log"].indexOf(r.type)||o.isDateTime(t.name)&&"date"===r.type)?t.name:a;for(var f="multicategory"===r.type?r.r2c_just_indices(l):r.d2c(l,0,t[e+"calendar"]),d=t._length,p=new Array(d),h=0;h<d;h++)p[h]=f;return[p]}(e,_,b,T[L]),I=E[0],R=E[1],F=o.distinctVals(I),N=F.vals,B=F.minDiff/2,H="all"===(e.boxpoints||e.points)?o.identity:function(t){return t.v<S.lf||t.v>S.uf};if(e._hasPreCompStats){var j=e[x],U=function(t){return y.d2c((e[t]||[])[r])},V=1/0,q=-1/0;for(r=0;r<e._length;r++){var G=I[r];if(n(G)){if((S={}).pos=S[_]=G,w&&R&&(S.orig_p=R[r]),S.q1=U("q1"),S.med=U("median"),S.q3=U("q3"),C=[],j&&o.isArrayOrTypedArray(j[r]))for(c=0;c<j[r].length;c++)(P=y.d2c(j[r][c]))!==l&&(u(z={v:P,i:[r,c]},e,[r,c]),C.push(z));if(S.pts=C.sort(f),D=(O=S[x]=C.map(d)).length,S.med!==l&&S.q1!==l&&S.q3!==l&&S.med>=S.q1&&S.q3>=S.med){var Z=U("lowerfence");S.lf=Z!==l&&Z<=S.q1?Z:p(S,O,D);var Y=U("upperfence");S.uf=Y!==l&&Y>=S.q3?Y:h(S,O,D);var X=U("mean");S.mean=X!==l?X:D?o.mean(O,D):(S.q1+S.q3)/2;var W=U("sd");S.sd=X!==l&&W>=0?W:D?o.stdev(O,D,S.mean):S.q3-S.q1,S.lo=g(S),S.uo=v(S);var Q=U("notchspan");Q=Q!==l&&Q>0?Q:m(S,D),S.ln=S.med-Q,S.un=S.med+Q;var J=S.lf,$=S.uf;e.boxpoints&&O.length&&(J=Math.min(J,O[0]),$=Math.max($,O[D-1])),e.notched&&(J=Math.min(J,S.ln),$=Math.max($,S.un)),S.min=J,S.max=$}else{var K;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+S.q1,"median = "+S.med,"q3 = "+S.q3].join("\n")),K=S.med!==l?S.med:S.q1!==l?S.q3!==l?(S.q1+S.q3)/2:S.q1:S.q3!==l?S.q3:0,S.med=K,S.q1=S.q3=K,S.lf=S.uf=K,S.mean=S.sd=K,S.ln=S.un=K,S.min=S.max=K}V=Math.min(V,S.min),q=Math.max(q,S.max),S.pts2=C.filter(H),A.push(S)}}e._extremes[y._id]=a.findExtremes(y,[V,q],{padded:!0})}else{var tt=y.makeCalcdata(e,x),et=function(t,e){for(var r=t.length,n=new Array(r+1),a=0;a<r;a++)n[a]=t[a]-e;return n[r]=t[r-1]+e,n}(N,B),rt=N.length,nt=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=[];return e}(rt);for(r=0;r<e._length;r++)if(P=tt[r],n(P)){var at=o.findBin(I[r],et);at>=0&&at<rt&&(u(z={v:P,i:r},e,r),nt[at].push(z))}var it=1/0,ot=-1/0,lt=e.quartilemethod,st="exclusive"===lt,ct="inclusive"===lt;for(r=0;r<rt;r++)if(nt[r].length>0){var ut,ft;if((S={}).pos=S[_]=N[r],C=S.pts=nt[r].sort(f),D=(O=S[x]=C.map(d)).length,S.min=O[0],S.max=O[D-1],S.mean=o.mean(O,D),S.sd=o.stdev(O,D,S.mean),S.med=o.interp(O,.5),D%2&&(st||ct))st?(ut=O.slice(0,D/2),ft=O.slice(D/2+1)):ct&&(ut=O.slice(0,D/2+1),ft=O.slice(D/2)),S.q1=o.interp(ut,.5),S.q3=o.interp(ft,.5);else S.q1=o.interp(O,.25),S.q3=o.interp(O,.75);S.lf=p(S,O,D),S.uf=h(S,O,D),S.lo=g(S),S.uo=v(S);var dt=m(S,D);S.ln=S.med-dt,S.un=S.med+dt,it=Math.min(it,S.ln),ot=Math.max(ot,S.un),S.pts2=C.filter(H),A.push(S)}e._extremes[y._id]=a.findExtremes(y,e.notched?tt.concat([it,ot]):tt,{padded:!0})}return function(t,e){if(o.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r<t.length;r++){for(var n=t[r].pts||[],a={},i=0;i<n.length;i++)a[n[i].i]=i;o.tagSelected(n,e,a)}}(A,e),A.length>0?(A[0].t={num:T[L],dPos:B,posLetter:_,valLetter:x,labels:{med:s(t,"median:"),min:s(t,"min:"),q1:s(t,"q1:"),q3:s(t,"q3:"),max:s(t,"max:"),mean:"sd"===e.boxmean?s(t,"mean \xb1 \u03c3:"):s(t,"mean:"),lf:s(t,"lower fence:"),uf:s(t,"upper fence:")}},T[L]++,A):[{t:{empty:!0}}]};var c={text:"tx",hovertext:"htx"};function u(t,e,r){for(var n in c)o.isArrayOrTypedArray(e[n])&&(Array.isArray(r)?o.isArrayOrTypedArray(e[n][r[0]])&&(t[c[n]]=e[n][r[0]][r[1]]):t[c[n]]=e[n][r])}function f(t,e){return t.v-e.v}function d(t){return t.v}function p(t,e,r){return 0===r?t.q1:Math.min(t.q1,e[Math.min(o.findBin(2.5*t.q1-1.5*t.q3,e,!0)+1,r-1)])}function h(t,e,r){return 0===r?t.q3:Math.max(t.q3,e[Math.max(o.findBin(2.5*t.q3-1.5*t.q1,e),0)])}function g(t){return 4*t.q1-3*t.q3}function v(t){return 4*t.q3-3*t.q1}function m(t,e){return 0===e?0:1.57*(t.q3-t.q1)/Math.sqrt(e)}},{"../../constants/numerical":212,"../../lib":233,"../../plots/cartesian/align_period":276,"../../plots/cartesian/axes":279,"fast-isnumeric":23}],355:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib"),i=t("../../plots/cartesian/constraints").getAxisGroup,o=["v","h"];function l(t,e,r,o){var l,s,c,u=e.calcdata,f=e._fullLayout,d=o._id,p=d.charAt(0),h=[],g=0;for(l=0;l<r.length;l++)for(c=u[r[l]],s=0;s<c.length;s++)h.push(o.c2l(c[s].pos,!0)),g+=(c[s].pts2||[]).length;if(h.length){var v=a.distinctVals(h,{unitMinDiff:"category"===o.type||"multicategory"===o.type}),m=v.minDiff/2;n.minDtick(o,v.minDiff,v.vals[0],!0);var y=f["violin"===t?"_numViolins":"_numBoxes"],x="group"===f[t+"mode"]&&y>1,b=1-f[t+"gap"],_=1-f[t+"groupgap"];for(l=0;l<r.length;l++){var w,T,k,M,A,L,S=(c=u[r[l]])[0].trace,C=c[0].t,O=S.width,D=S.side;if(O)w=T=M=O/2,k=0;else if(w=m,x){var z=i(f,o._id)+S.orientation,P=(f._alignmentOpts[z]||{})[S.alignmentgroup]||{},E=Object.keys(P.offsetGroups||{}).length,I=E||y;T=w*b*_/I,k=2*w*(((E?S._offsetIndex:C.num)+.5)/I-.5)*b,M=w*b/I}else T=w*b*_,k=0,M=w;C.dPos=w,C.bPos=k,C.bdPos=T,C.wHover=M;var R,F,N,B,H,j,U=k+T,V=Boolean(O);if("positive"===D?(A=w*(O?1:.5),R=U,L=R=k):"negative"===D?(A=R=k,L=w*(O?1:.5),F=U):(A=L=w,R=F=U),(S.boxpoints||S.points)&&g>0){var q=S.pointpos,G=S.jitter,Z=S.marker.size/2,Y=0;q+G>=0&&((Y=U*(q+G))>A?(V=!0,H=Z,N=Y):Y>R&&(H=Z,N=A)),Y<=A&&(N=A);var X=0;q-G<=0&&((X=-U*(q-G))>L?(V=!0,j=Z,B=X):X>F&&(j=Z,B=L)),X<=L&&(B=L)}else N=A,B=L;var W=new Array(c.length);for(s=0;s<c.length;s++)W[s]=c[s].pos;S._extremes[d]=n.findExtremes(o,W,{padded:V,vpadminus:B,vpadplus:N,vpadLinearized:!0,ppadminus:{x:j,y:H}[p],ppadplus:{x:H,y:j}[p]})}}}e.exports={crossTraceCalc:function(t,e){for(var r=t.calcdata,n=e.xaxis,a=e.yaxis,i=0;i<o.length;i++){for(var s=o[i],c="h"===s?a:n,u=[],f=0;f<r.length;f++){var d=r[f],p=d[0].t,h=d[0].trace;!0!==h.visible||"box"!==h.type&&"candlestick"!==h.type||p.empty||(h.orientation||"v")!==s||h.xaxis!==n._id||h.yaxis!==a._id||u.push(f)}l("box",t,u,c)}},setPositionOffset:l}},{"../../lib":233,"../../plots/cartesian/axes":279,"../../plots/cartesian/constraints":286}],356:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("../../components/color"),o=t("../scatter/period_defaults"),l=t("../bar/defaults").handleGroupingDefaults,s=t("../../plots/cartesian/axis_autotype"),c=t("./attributes");function u(t,e,r,i){function o(t){var e=0;return t&&t.length&&(e+=1,n.isArrayOrTypedArray(t[0])&&t[0].length&&(e+=1)),e}function l(e){return n.validate(t[e],c[e])}var u,f=r("y"),d=r("x");if("box"===e.type){var p=r("q1"),h=r("median"),g=r("q3");e._hasPreCompStats=p&&p.length&&h&&h.length&&g&&g.length,u=Math.min(n.minRowLength(p),n.minRowLength(h),n.minRowLength(g))}var v,m,y=o(f),x=o(d),b=y&&n.minRowLength(f),_=x&&n.minRowLength(d),w=i.calendar,T={autotypenumbers:i.autotypenumbers};if(e._hasPreCompStats)switch(String(x)+String(y)){case"00":var k=l("x0")||l("dx");v=(l("y0")||l("dy"))&&!k?"h":"v",m=u;break;case"10":v="v",m=Math.min(u,_);break;case"20":v="h",m=Math.min(u,d.length);break;case"01":v="h",m=Math.min(u,b);break;case"02":v="v",m=Math.min(u,f.length);break;case"12":v="v",m=Math.min(u,_,f.length);break;case"21":v="h",m=Math.min(u,d.length,b);break;case"11":m=0;break;case"22":var M,A=!1;for(M=0;M<d.length;M++)if("category"===s(d[M],w,T)){A=!0;break}if(A)v="v",m=Math.min(u,_,f.length);else{for(M=0;M<f.length;M++)if("category"===s(f[M],w,T)){A=!0;break}A?(v="h",m=Math.min(u,d.length,b)):(v="v",m=Math.min(u,_,f.length))}}else y>0?(v="v",m=x>0?Math.min(_,b):Math.min(b)):x>0?(v="h",m=Math.min(_)):m=0;if(m){e._length=m;var L=r("orientation",v);e._hasPreCompStats?"v"===L&&0===x?(r("x0",0),r("dx",1)):"h"===L&&0===y&&(r("y0",0),r("dy",1)):"v"===L&&0===x?r("x0"):"h"===L&&0===y&&r("y0"),a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],i)}else e.visible=!1}function f(t,e,r,a){var i=a.prefix,o=n.coerce2(t,e,c,"marker.outliercolor"),l=r("marker.line.outliercolor"),s="outliers";e._hasPreCompStats?s="all":(o||l)&&(s="suspectedoutliers");var u=r(i+"points",s);u?(r("jitter","all"===u?.3:0),r("pointpos","all"===u?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===u&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete e.marker;var f=r("hoveron");"all"!==f&&-1===f.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(e,r)}e.exports={supplyDefaults:function(t,e,r,a){function l(r,a){return n.coerce(t,e,c,r,a)}if(u(t,e,l,a),!1!==e.visible){o(t,e,a,l);var s=e._hasPreCompStats;s&&(l("lowerfence"),l("upperfence")),l("line.color",(t.marker||{}).color||r),l("line.width"),l("fillcolor",i.addOpacity(e.line.color,.5));var d=!1;if(s){var p=l("mean"),h=l("sd");p&&p.length&&(d=!0,h&&h.length&&(d="sd"))}l("boxmean",d),l("whiskerwidth"),l("width"),l("quartilemethod");var g=!1;if(s){var v=l("notchspan");v&&v.length&&(g=!0)}else n.validate(t.notchwidth,c.notchwidth)&&(g=!0);l("notched",g)&&l("notchwidth"),f(t,e,l,{prefix:"box"})}},crossTraceDefaults:function(t,e){var r,a;function i(t){return n.coerce(a._input,a,c,t)}for(var o=0;o<t.length;o++){var s=(a=t[o]).type;"box"!==s&&"violin"!==s||(r=a._input,"group"===e[s+"mode"]&&l(r,a,e,i))}},handleSampleDefaults:u,handlePointsDefaults:f}},{"../../components/color":105,"../../lib":233,"../../plots/cartesian/axis_autotype":280,"../../registry":326,"../bar/defaults":340,"../scatter/period_defaults":467,"./attributes":353}],357:[function(t,e,r){"use strict";e.exports=function(t,e){return e.hoverOnBox&&(t.hoverOnBox=e.hoverOnBox),"xVal"in e&&(t.x=e.xVal),"yVal"in e&&(t.y=e.yVal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}},{}],358:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib"),i=t("../../components/fx"),o=t("../../components/color"),l=a.fillText;function s(t,e,r,l){var s,c,u,f,d,p,h,g,v,m,y,x,b,_,w=t.cd,T=t.xa,k=t.ya,M=w[0].trace,A=w[0].t,L="violin"===M.type,S=[],C=A.bdPos,O=A.wHover,D=function(t){return u.c2l(t.pos)+A.bPos-u.c2l(p)};L&&"both"!==M.side?("positive"===M.side&&(v=function(t){var e=D(t);return i.inbox(e,e+O,m)},x=C,b=0),"negative"===M.side&&(v=function(t){var e=D(t);return i.inbox(e-O,e,m)},x=0,b=C)):(v=function(t){var e=D(t);return i.inbox(e-O,e+O,m)},x=b=C),_=L?function(t){return i.inbox(t.span[0]-d,t.span[1]-d,m)}:function(t){return i.inbox(t.min-d,t.max-d,m)},"h"===M.orientation?(d=e,p=r,h=_,g=v,s="y",u=k,c="x",f=T):(d=r,p=e,h=v,g=_,s="x",u=T,c="y",f=k);var z=Math.min(1,C/Math.abs(u.r2c(u.range[1])-u.r2c(u.range[0])));function P(t){return(h(t)+g(t))/2}m=t.maxHoverDistance-z,y=t.maxSpikeDistance-z;var E=i.getDistanceFunction(l,h,g,P);if(i.getClosest(w,E,t),!1===t.index)return[];var I=w[t.index],R=M.line.color,F=(M.marker||{}).color;o.opacity(R)&&M.line.width?t.color=R:o.opacity(F)&&M.boxpoints?t.color=F:t.color=M.fillcolor,t[s+"0"]=u.c2p(I.pos+A.bPos-b,!0),t[s+"1"]=u.c2p(I.pos+A.bPos+x,!0),t[s+"LabelVal"]=void 0!==I.orig_p?I.orig_p:I.pos;var N=s+"Spike";t.spikeDistance=P(I)*y/m,t[N]=u.c2p(I.pos,!0);var B={},H=["med","q1","q3","min","max"];(M.boxmean||(M.meanline||{}).visible)&&H.push("mean"),(M.boxpoints||M.points)&&H.push("lf","uf");for(var j=0;j<H.length;j++){var U=H[j];if(U in I&&!(I[U]in B)){B[I[U]]=!0;var V=I[U],q=f.c2p(V,!0),G=a.extendFlat({},t);G.attr=U,G[c+"0"]=G[c+"1"]=q,G[c+"LabelVal"]=V,G[c+"Label"]=(A.labels?A.labels[U]+" ":"")+n.hoverLabelText(f,V),G.hoverOnBox=!0,"mean"===U&&"sd"in I&&"sd"===M.boxmean&&(G[c+"err"]=I.sd),t.name="",t.spikeDistance=void 0,t[N]=void 0,G.hovertemplate=!1,S.push(G)}}return S}function c(t,e,r){for(var n,o,s,c=t.cd,u=t.xa,f=t.ya,d=c[0].trace,p=u.c2p(e),h=f.c2p(r),g=i.quadrature((function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(u.c2p(t.x)-p)-e,1-3/e)}),(function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(f.c2p(t.y)-h)-e,1-3/e)})),v=!1,m=0;m<c.length;m++){o=c[m];for(var y=0;y<(o.pts||[]).length;y++){var x=g(s=o.pts[y]);x<=t.distance&&(t.distance=x,v=[m,y])}}if(!v)return!1;s=(o=c[v[0]]).pts[v[1]];var b=u.c2p(s.x,!0),_=f.c2p(s.y,!0),w=s.mrc||1;n=a.extendFlat({},t,{index:s.i,color:(d.marker||{}).color,name:d.name,x0:b-w,x1:b+w,y0:_-w,y1:_+w,spikeDistance:t.distance,hovertemplate:d.hovertemplate});var T,k=o.orig_p,M=void 0!==k?k:o.pos;return"h"===d.orientation?(T=f,n.xLabelVal=s.x,n.yLabelVal=M):(T=u,n.xLabelVal=M,n.yLabelVal=s.y),n[T._id.charAt(0)+"Spike"]=T.c2p(o.pos,!0),l(s,d,n),n}e.exports={hoverPoints:function(t,e,r,n){var a,i=t.cd[0].trace.hoveron,o=[];return-1!==i.indexOf("boxes")&&(o=o.concat(s(t,e,r,n))),-1!==i.indexOf("points")&&(a=c(t,e,r)),"closest"===n?a?[a]:o:a?(o.push(a),o):o},hoverOnBoxes:s,hoverOnPoints:c}},{"../../components/color":105,"../../components/fx":145,"../../lib":233,"../../plots/cartesian/axes":279}],359:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults").supplyLayoutDefaults,calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc").crossTraceCalc,plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"box",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":292,"./attributes":353,"./calc":354,"./cross_trace_calc":355,"./defaults":356,"./event_data":357,"./hover":358,"./layout_attributes":360,"./layout_defaults":361,"./plot":362,"./select":363,"./style":364}],360:[function(t,e,r){"use strict";e.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}},{}],361:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("./layout_attributes");function o(t,e,r,a,i){for(var o=i+"Layout",l=!1,s=0;s<r.length;s++){var c=r[s];if(n.traceIs(c,o)){l=!0;break}}l&&(a(i+"mode"),a(i+"gap"),a(i+"groupgap"))}e.exports={supplyLayoutDefaults:function(t,e,r){o(0,0,r,(function(r,n){return a.coerce(t,e,i,r,n)}),"box")},_supply:o}},{"../../lib":233,"../../registry":326,"./layout_attributes":360}],362:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing");function o(t,e,r,i){var o,l,s="h"===r.orientation,c=e.val,u=e.pos,f=!!u.rangebreaks,d=i.bPos,p=i.wdPos||0,h=i.bPosPxOffset||0,g=r.whiskerwidth||0,v=r.notched||!1,m=v?1-2*r.notchwidth:1;Array.isArray(i.bdPos)?(o=i.bdPos[0],l=i.bdPos[1]):(o=i.bdPos,l=i.bdPos);var y=t.selectAll("path.box").data("violin"!==r.type||r.box.visible?a.identity:[]);y.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","box"),y.exit().remove(),y.each((function(t){if(t.empty)return"M0,0Z";var e=u.c2l(t.pos+d,!0),i=u.l2p(e-o)+h,y=u.l2p(e+l)+h,x=f?(i+y)/2:u.l2p(e)+h,b=r.whiskerwidth,_=f?i*b+(1-b)*x:u.l2p(e-p)+h,w=f?y*b+(1-b)*x:u.l2p(e+p)+h,T=u.l2p(e-o*m)+h,k=u.l2p(e+l*m)+h,M=c.c2p(t.q1,!0),A=c.c2p(t.q3,!0),L=a.constrain(c.c2p(t.med,!0),Math.min(M,A)+1,Math.max(M,A)-1),S=void 0===t.lf||!1===r.boxpoints,C=c.c2p(S?t.min:t.lf,!0),O=c.c2p(S?t.max:t.uf,!0),D=c.c2p(t.ln,!0),z=c.c2p(t.un,!0);s?n.select(this).attr("d","M"+L+","+T+"V"+k+"M"+M+","+i+"V"+y+(v?"H"+D+"L"+L+","+k+"L"+z+","+y:"")+"H"+A+"V"+i+(v?"H"+z+"L"+L+","+T+"L"+D+","+i:"")+"ZM"+M+","+x+"H"+C+"M"+A+","+x+"H"+O+(0===g?"":"M"+C+","+_+"V"+w+"M"+O+","+_+"V"+w)):n.select(this).attr("d","M"+T+","+L+"H"+k+"M"+i+","+M+"H"+y+(v?"V"+D+"L"+k+","+L+"L"+y+","+z:"")+"V"+A+"H"+i+(v?"V"+z+"L"+T+","+L+"L"+i+","+D:"")+"ZM"+x+","+M+"V"+C+"M"+x+","+A+"V"+O+(0===g?"":"M"+_+","+C+"H"+w+"M"+_+","+O+"H"+w))}))}function l(t,e,r,n){var o=e.x,l=e.y,s=n.bdPos,c=n.bPos,u=r.boxpoints||r.points;a.seedPseudoRandom();var f=t.selectAll("g.points").data(u?function(t){return t.forEach((function(t){t.t=n,t.trace=r})),t}:[]);f.enter().append("g").attr("class","points"),f.exit().remove();var d=f.selectAll("path").data((function(t){var e,n,i=t.pts2,o=Math.max((t.max-t.min)/10,t.q3-t.q1),l=1e-9*o,f=.01*o,d=[],p=0;if(r.jitter){if(0===o)for(p=1,d=new Array(i.length),e=0;e<i.length;e++)d[e]=1;else for(e=0;e<i.length;e++){var h=Math.max(0,e-5),g=i[h].v,v=Math.min(i.length-1,e+5),m=i[v].v;"all"!==u&&(i[e].v<t.lf?m=Math.min(m,t.lf):g=Math.max(g,t.uf));var y=Math.sqrt(f*(v-h)/(m-g+l))||0;y=a.constrain(Math.abs(y),0,1),d.push(y),p=Math.max(y,p)}n=2*r.jitter/(p||1)}for(e=0;e<i.length;e++){var x=i[e],b=x.v,_=r.jitter?n*d[e]*(a.pseudoRandom()-.5):0,w=t.pos+c+s*(r.pointpos+_);"h"===r.orientation?(x.y=w,x.x=b):(x.x=w,x.y=b),"suspectedoutliers"===u&&b<t.uo&&b>t.lo&&(x.so=!0)}return i}));d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(i.translatePoints,o,l)}function s(t,e,r,i){var o,l,s=e.val,c=e.pos,u=!!c.rangebreaks,f=i.bPos,d=i.bPosPxOffset||0,p=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],l=i.bdPos[1]):(o=i.bdPos,l=i.bdPos);var h=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?a.identity:[]);h.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),h.exit().remove(),h.each((function(t){var e=c.c2l(t.pos+f,!0),a=c.l2p(e-o)+d,i=c.l2p(e+l)+d,h=u?(a+i)/2:c.l2p(e)+d,g=s.c2p(t.mean,!0),v=s.c2p(t.mean-t.sd,!0),m=s.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+g+","+a+"V"+i+("sd"===p?"m0,0L"+v+","+h+"L"+g+","+a+"L"+m+","+h+"Z":"")):n.select(this).attr("d","M"+a+","+g+"H"+i+("sd"===p?"m0,0L"+h+","+v+"L"+a+","+g+"L"+h+","+m+"Z":""))}))}e.exports={plot:function(t,e,r,i){var c=e.xaxis,u=e.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(t){var e,r,a=n.select(this),i=t[0],f=i.t,d=i.trace;(f.wdPos=f.bdPos*d.whiskerwidth,!0!==d.visible||f.empty)?a.remove():("h"===d.orientation?(e=u,r=c):(e=c,r=u),o(a,{pos:e,val:r},d,f),l(a,{x:c,y:u},d,f),s(a,{pos:e,val:r},d,f))}))},plotBoxAndWhiskers:o,plotPoints:l,plotBoxMean:s}},{"../../components/drawing":127,"../../lib":233,d3:21}],363:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,a=t.cd,i=t.xaxis,o=t.yaxis,l=[];if(!1===e)for(r=0;r<a.length;r++)for(n=0;n<(a[r].pts||[]).length;n++)a[r].pts[n].selected=0;else for(r=0;r<a.length;r++)for(n=0;n<(a[r].pts||[]).length;n++){var s=a[r].pts[n],c=i.c2p(s.x),u=o.c2p(s.y);e.contains([c,u],null,s.i,t)?(l.push({pointNumber:s.i,x:i.c2d(s.x),y:o.c2d(s.y)}),s.selected=1):s.selected=0}return l}},{}],364:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/color"),i=t("../../components/drawing");e.exports={style:function(t,e,r){var o=r||n.select(t).selectAll("g.trace.boxes");o.style("opacity",(function(t){return t[0].trace.opacity})),o.each((function(e){var r=n.select(this),o=e[0].trace,l=o.line.width;function s(t,e,r,n){t.style("stroke-width",e+"px").call(a.stroke,r).call(a.fill,n)}var c=r.selectAll("path.box");if("candlestick"===o.type)c.each((function(t){if(!t.empty){var e=n.select(this),r=o[t.dir];s(e,r.line.width,r.line.color,r.fillcolor),e.style("opacity",o.selectedpoints&&!t.selected?.3:1)}}));else{s(c,l,o.line.color,o.fillcolor),r.selectAll("path.mean").style({"stroke-width":l,"stroke-dasharray":2*l+"px,"+l+"px"}).call(a.stroke,o.line.color);var u=r.selectAll("path.point");i.pointStyle(u,o,t)}}))},styleOnSelect:function(t,e,r){var n=e[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,t)}}},{"../../components/color":105,"../../components/drawing":127,d3:21}],365:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),a=t("../scatter/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../components/drawing/attributes").dash,l=t("../../plots/font_attributes"),s=t("../../lib/extend").extendFlat,c=t("../../constants/filter_ops"),u=c.COMPARISON_OPS2,f=c.INTERVAL_OPS,d=(t("../../constants/docs").FORMAT_LINK,a.line);e.exports=s({z:n.z,x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:a.xperiod0,yperiod0:a.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,text:n.text,hovertext:n.hovertext,transpose:n.transpose,xtype:n.xtype,ytype:n.ytype,zhoverformat:n.zhoverformat,hovertemplate:n.hovertemplate,hoverongaps:n.hoverongaps,connectgaps:s({},n.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:l({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot"},operation:{valType:"enumerated",values:[].concat(u).concat(f),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:s({},d.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:o,smoothing:s({},d.smoothing,{}),editType:"plot"}},i("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":112,"../../components/drawing/attributes":126,"../../constants/docs":209,"../../constants/filter_ops":210,"../../lib/extend":227,"../../plots/font_attributes":307,"../heatmap/attributes":387,"../scatter/attributes":447}],366:[function(t,e,r){"use strict";var n=t("../../components/colorscale"),a=t("../heatmap/calc"),i=t("./set_contours"),o=t("./end_plus");e.exports=function(t,e){var r=a(t,e),l=r[0].z;i(e,l);var s,c=e.contours,u=n.extractOpts(e);if("heatmap"===c.coloring&&u.auto&&!1===e.autocontour){var f=c.start,d=o(c),p=c.size||1,h=Math.floor((d-f)/p)+1;isFinite(p)||(p=1,h=1);var g=f-p/2;s=[g,g+h*p]}else s=l;return n.calc(t,e,{vals:s,cLetter:"z"}),r}},{"../../components/colorscale":117,"../heatmap/calc":388,"./end_plus":376,"./set_contours":384}],367:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t[0],a=n.z;switch(e.type){case"levels":var i=Math.min(a[0][0],a[0][1]);for(r=0;r<t.length;r++){var o=t[r];o.prefixBoundary=!o.edgepaths.length&&(i>o.level||o.starts.length&&i===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var l=n.x.length,s=n.y.length,c=-1/0,u=1/0;for(r=0;r<s;r++)u=Math.min(u,a[r][0]),u=Math.min(u,a[r][l-1]),c=Math.max(c,a[r][0]),c=Math.max(c,a[r][l-1]);for(r=1;r<l-1;r++)u=Math.min(u,a[0][r]),u=Math.min(u,a[s-1][r]),c=Math.max(c,a[0][r]),c=Math.max(c,a[s-1][r]);var f,d,p=e.value;switch(e._operation){case">":p>c&&(n.prefixBoundary=!0);break;case"<":(p<u||n.starts.length&&p===u)&&(n.prefixBoundary=!0);break;case"[]":f=Math.min(p[0],p[1]),((d=Math.max(p[0],p[1]))<u||f>c||n.starts.length&&d===u)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(p[0],p[1]),d=Math.max(p[0],p[1]),f<u&&d>c&&(n.prefixBoundary=!0)}}}},{}],368:[function(t,e,r){"use strict";var n=t("../../components/colorscale"),a=t("./make_color_map"),i=t("./end_plus");e.exports={min:"zmin",max:"zmax",calc:function(t,e,r){var o=e.contours,l=e.line,s=o.size||1,c=o.coloring,u=a(e,{isColorbar:!0});if("heatmap"===c){var f=n.extractOpts(e);r._fillgradient=f.reversescale?n.flipScale(f.colorscale):f.colorscale,r._zrange=[f.min,f.max]}else"fill"===c&&(r._fillcolor=u);r._line={color:"lines"===c?u:l.color,width:!1!==o.showlines?l.width:0,dash:l.dash},r._levels={start:o.start,end:i(o),size:s}}}},{"../../components/colorscale":117,"./end_plus":376,"./make_color_map":381}],369:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],370:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./label_defaults"),i=t("../../components/color"),o=i.addOpacity,l=i.opacity,s=t("../../constants/filter_ops"),c=s.CONSTRAINT_REDUCTION,u=s.COMPARISON_OPS2;e.exports=function(t,e,r,i,s,f){var d,p,h,g=e.contours,v=r("contours.operation");(g._operation=c[v],function(t,e){var r;-1===u.indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:n(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),n(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(r,g),"="===v?d=g.showlines=!0:(d=r("contours.showlines"),h=r("fillcolor",o((t.line||{}).color||s,.5))),d)&&(p=r("line.color",h&&l(h)?o(e.fillcolor,1):s),r("line.width",2),r("line.dash"));r("line.smoothing"),a(r,i,p,f)}},{"../../components/color":105,"../../constants/filter_ops":210,"./label_defaults":380,"fast-isnumeric":23}],371:[function(t,e,r){"use strict";var n=t("../../constants/filter_ops"),a=t("fast-isnumeric");function i(t,e){var r,i=Array.isArray(e);function o(t){return a(t)?+t:null}return-1!==n.COMPARISON_OPS2.indexOf(t)?r=o(i?e[0]:e):-1!==n.INTERVAL_OPS.indexOf(t)?r=i?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==n.SET_OPS.indexOf(t)&&(r=i?e.map(o):[o(e)]),r}function o(t){return function(e){e=i(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function l(t){return function(e){return{start:e=i(t,e),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":l(">"),"<":l("<"),"=":l("=")}},{"../../constants/filter_ops":210,"fast-isnumeric":23}],372:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=n("contours.start"),i=n("contours.end"),o=!1===a||!1===i,l=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&l||r("ncontours")}},{}],373:[function(t,e,r){"use strict";var n=t("../../lib");function a(t){return n.extendFlat({},t,{edgepaths:n.extendDeep([],t.edgepaths),paths:n.extendDeep([],t.paths),starts:n.extendDeep([],t.starts)})}e.exports=function(t,e){var r,i,o,l=function(t){return t.reverse()},s=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&n.warn("Contour data invalid for the specified inequality operation."),i=t[0],r=0;r<i.edgepaths.length;r++)i.edgepaths[r]=l(i.edgepaths[r]);for(r=0;r<i.paths.length;r++)i.paths[r]=l(i.paths[r]);for(r=0;r<i.starts.length;r++)i.starts[r]=l(i.starts[r]);return t;case"][":var c=l;l=s,s=c;case"[]":for(2!==t.length&&n.warn("Contour data invalid for the specified inequality range operation."),i=a(t[0]),o=a(t[1]),r=0;r<i.edgepaths.length;r++)i.edgepaths[r]=l(i.edgepaths[r]);for(r=0;r<i.paths.length;r++)i.paths[r]=l(i.paths[r]);for(r=0;r<i.starts.length;r++)i.starts[r]=l(i.starts[r]);for(;o.edgepaths.length;)i.edgepaths.push(s(o.edgepaths.shift()));for(;o.paths.length;)i.paths.push(s(o.paths.shift()));for(;o.starts.length;)i.starts.push(s(o.starts.shift()));return[i]}}},{"../../lib":233}],374:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../heatmap/xyz_defaults"),i=t("../scatter/period_defaults"),o=t("./constraint_defaults"),l=t("./contours_defaults"),s=t("./style_defaults"),c=t("./attributes");e.exports=function(t,e,r,u){function f(r,a){return n.coerce(t,e,c,r,a)}if(a(t,e,f,u)){i(t,e,u,f),f("text"),f("hovertext"),f("hovertemplate"),f("hoverongaps");var d="constraint"===f("contours.type");f("connectgaps",n.isArray1D(e.z)),d?o(t,e,f,u,r):(l(t,e,f,(function(r){return n.coerce2(t,e,c,r)})),s(t,e,f,u))}else e.visible=!1}},{"../../lib":233,"../heatmap/xyz_defaults":401,"../scatter/period_defaults":467,"./attributes":365,"./constraint_defaults":370,"./contours_defaults":372,"./style_defaults":386}],375:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./constraint_mapping"),i=t("./end_plus");e.exports=function(t,e,r){for(var o="constraint"===t.type?a[t._operation](t.value):t,l=o.size,s=[],c=i(o),u=r.trace._carpetTrace,f=u?{xaxis:u.aaxis,yaxis:u.baxis,x:r.a,y:r.b}:{xaxis:e.xaxis,yaxis:e.yaxis,x:r.x,y:r.y},d=o.start;d<c;d+=l)if(s.push(n.extendFlat({level:d,crossings:{},starts:[],edgepaths:[],paths:[],z:r.z,smoothing:r.trace.line.smoothing},f)),s.length>1e3){n.warn("Too many contours, clipping at 1000",t);break}return s}},{"../../lib":233,"./constraint_mapping":371,"./end_plus":376}],376:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],377:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./constants");function i(t,e,r,n){return Math.abs(t[0]-e[0])<r&&Math.abs(t[1]-e[1])<n}function o(t,e,r,o,s){var c,u=e.join(","),f=t.crossings[u],d=function(t,e,r){var n=0,i=0;t>20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==a.BOTTOMSTART.indexOf(t)?i=1:-1!==a.LEFTSTART.indexOf(t)?n=1:-1!==a.TOPSTART.indexOf(t)?i=-1:n=-1;return[n,i]}(f,r,e),p=[l(t,e,[-d[0],-d[1]])],h=t.z.length,g=t.z[0].length,v=e.slice(),m=d.slice();for(c=0;c<1e4;c++){if(f>20?(f=a.CHOOSESADDLE[f][(d[0]||d[1])<0?0:1],t.crossings[u]=a.SADDLEREMAINDER[f]):delete t.crossings[u],!(d=a.NEWDELTA[f])){n.log("Found bad marching index:",f,e,t.level);break}p.push(l(t,e,d)),e[0]+=d[0],e[1]+=d[1],u=e.join(","),i(p[p.length-1],p[p.length-2],o,s)&&p.pop();var y=d[0]&&(e[0]<0||e[0]>g-2)||d[1]&&(e[1]<0||e[1]>h-2);if(e[0]===v[0]&&e[1]===v[1]&&d[0]===m[0]&&d[1]===m[1]||r&&y)break;f=t.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,T,k,M,A,L,S,C,O,D,z,P,E=i(p[0],p[p.length-1],o,s),I=0,R=.2*t.smoothing,F=[],N=0;for(c=1;c<p.length;c++)O=p[c],D=p[c-1],z=void 0,P=void 0,z=O[2]-D[2],P=O[3]-D[3],I+=M=Math.sqrt(z*z+P*P),F.push(M);var B=I/F.length*R;function H(t){return p[t%p.length]}for(c=p.length-2;c>=N;c--)if((x=F[c])<B){for(_=0,b=c-1;b>=N&&x+F[b]<B;b--)x+=F[b];if(E&&c===p.length-2)for(_=0;_<b&&x+F[_]<B;_++)x+=F[_];T=c-b+_+1,k=Math.floor((c+b+_+2)/2),w=E||c!==p.length-2?E||-1!==b?T%2?H(k):[(H(k)[0]+H(k+1)[0])/2,(H(k)[1]+H(k+1)[1])/2]:p[0]:p[p.length-1],p.splice(b+1,c-b+1,w),c=b+1,_&&(N=_),E&&(c===p.length-2?p[_]=p[p.length-1]:0===c&&(p[p.length-1]=p[0]))}for(p.splice(0,N),c=0;c<p.length;c++)p[c].length=2;if(!(p.length<2))if(E)p.pop(),t.paths.push(p);else{r||n.log("Unclosed interior contour?",t.level,v.join(","),p.join("L"));var j=!1;for(A=0;A<t.edgepaths.length;A++)if(S=t.edgepaths[A],!j&&i(S[0],p[p.length-1],o,s)){p.pop(),j=!0;var U=!1;for(L=0;L<t.edgepaths.length;L++)if(i((C=t.edgepaths[L])[C.length-1],p[0],o,s)){U=!0,p.shift(),t.edgepaths.splice(A,1),L===A?t.paths.push(p.concat(C)):(L>A&&L--,t.edgepaths[L]=C.concat(p,S));break}U||(t.edgepaths[A]=p.concat(S))}for(A=0;A<t.edgepaths.length&&!j;A++)i((S=t.edgepaths[A])[S.length-1],p[0],o,s)&&(p.shift(),t.edgepaths[A]=S.concat(p),j=!0);j||t.edgepaths.push(p)}}function l(t,e,r){var n=e[0]+Math.max(r[0],0),a=e[1]+Math.max(r[1],0),i=t.z[a][n],o=t.xaxis,l=t.yaxis;if(r[1]){var s=(t.level-i)/(t.z[a][n+1]-i);return[o.c2p((1-s)*t.x[n]+s*t.x[n+1],!0),l.c2p(t.y[a],!0),n+s,a]}var c=(t.level-i)/(t.z[a+1][n]-i);return[o.c2p(t.x[n],!0),l.c2p((1-c)*t.y[a]+c*t.y[a+1],!0),n,a+c]}e.exports=function(t,e,r){var a,i,l,s;for(e=e||.01,r=r||.01,i=0;i<t.length;i++){for(l=t[i],s=0;s<l.starts.length;s++)o(l,l.starts[s],"edge",e,r);for(a=0;Object.keys(l.crossings).length&&a<1e4;)a++,o(l,Object.keys(l.crossings)[0].split(",").map(Number),void 0,e,r);1e4===a&&n.log("Infinite loop in contour?")}}},{"../../lib":233,"./constants":369}],378:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../heatmap/hover");e.exports=function(t,e,r,i,o){var l=a(t,e,r,i,o,!0);return l&&l.forEach((function(t){var e=t.trace;"constraint"===e.contours.type&&(e.fillcolor&&n.opacity(e.fillcolor)?t.color=n.addOpacity(e.fillcolor,1):e.contours.showlines&&n.opacity(e.line.color)&&(t.color=n.addOpacity(e.line.color,1)))})),l}},{"../../components/color":105,"../heatmap/hover":394}],379:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot").plot,style:t("./style"),colorbar:t("./colorbar"),hoverPoints:t("./hover"),moduleType:"trace",name:"contour",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}},{"../../plots/cartesian":292,"./attributes":365,"./calc":366,"./colorbar":368,"./defaults":374,"./hover":378,"./plot":383,"./style":385}],380:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){if(a||(a={}),t("contours.showlabels")){var i=e.font;n.coerceFont(t,"contours.labelfont",{family:i.family,size:i.size,color:r}),t("contours.labelformat")}!1!==a.hasHover&&t("zhoverformat")}},{"../../lib":233}],381:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/colorscale"),i=t("./end_plus");e.exports=function(t){var e=t.contours,r=e.start,o=i(e),l=e.size||1,s=Math.floor((o-r)/l)+1,c="lines"===e.coloring?0:1,u=a.extractOpts(t);isFinite(l)||(l=1,s=1);var f,d,p=u.reversescale?a.flipScale(u.colorscale):u.colorscale,h=p.length,g=new Array(h),v=new Array(h);if("heatmap"===e.coloring){var m=u.min,y=u.max;for(d=0;d<h;d++)f=p[d],g[d]=f[0]*(y-m)+m,v[d]=f[1];var x=n.extent([m,y,e.start,e.start+l*(s-1)]),b=x[m<y?0:1],_=x[m<y?1:0];b!==m&&(g.splice(0,0,b),v.splice(0,0,v[0])),_!==y&&(g.push(_),v.push(v[v.length-1]))}else for(d=0;d<h;d++)f=p[d],g[d]=(f[0]*(s+c-1)-c/2)*l+r,v[d]=f[1];return a.makeColorScaleFunc({domain:g,range:v},{noNumericCheck:!0})}},{"../../components/colorscale":117,"./end_plus":376,d3:21}],382:[function(t,e,r){"use strict";var n=t("./constants");function a(t,e){var r=(e[0][0]>t?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(t){var e,r,i,o,l,s,c,u,f,d=t[0].z,p=d.length,h=d[0].length,g=2===p||2===h;for(r=0;r<p-1;r++)for(o=[],0===r&&(o=o.concat(n.BOTTOMSTART)),r===p-2&&(o=o.concat(n.TOPSTART)),e=0;e<h-1;e++)for(i=o.slice(),0===e&&(i=i.concat(n.LEFTSTART)),e===h-2&&(i=i.concat(n.RIGHTSTART)),l=e+","+r,s=[[d[r][e],d[r][e+1]],[d[r+1][e],d[r+1][e+1]]],f=0;f<t.length;f++)(c=a((u=t[f]).level,s))&&(u.crossings[l]=c,-1!==i.indexOf(c)&&(u.starts.push([e,r]),g&&-1!==i.indexOf(c,i.indexOf(c)+1)&&u.starts.push([e,r])))}},{"./constants":369}],383:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../../components/colorscale"),l=t("../../lib/svg_text_utils"),s=t("../../plots/cartesian/axes"),c=t("../../plots/cartesian/set_convert"),u=t("../heatmap/plot"),f=t("./make_crossings"),d=t("./find_all_paths"),p=t("./empty_pathinfo"),h=t("./convert_to_constraints"),g=t("./close_boundaries"),v=t("./constants"),m=v.LABELOPTIMIZER;function y(t,e){var r,n,o,l,s,c,u,f="",d=0,p=t.edgepaths.map((function(t,e){return e})),h=!0;function g(t){return Math.abs(t[1]-e[2][1])<.01}function v(t){return Math.abs(t[0]-e[0][0])<.01}function m(t){return Math.abs(t[0]-e[2][0])<.01}for(;p.length;){for(c=i.smoothopen(t.edgepaths[d],t.smoothing),f+=h?c:c.replace(/^M/,"L"),p.splice(p.indexOf(d),1),r=t.edgepaths[d][t.edgepaths[d].length-1],l=-1,o=0;o<4;o++){if(!r){a.log("Missing end?",d,t);break}for(u=r,Math.abs(u[1]-e[0][1])<.01&&!m(r)?n=e[1]:v(r)?n=e[0]:g(r)?n=e[3]:m(r)&&(n=e[2]),s=0;s<t.edgepaths.length;s++){var y=t.edgepaths[s][0];Math.abs(r[0]-n[0])<.01?Math.abs(r[0]-y[0])<.01&&(y[1]-r[1])*(n[1]-y[1])>=0&&(n=y,l=s):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-y[1])<.01&&(y[0]-r[0])*(n[0]-y[0])>=0&&(n=y,l=s):a.log("endpt to newendpt is not vert. or horz.",r,n,y)}if(r=n,l>=0)break;f+="L"+n}if(l===t.edgepaths.length){a.log("unclosed perimeter path");break}d=l,(h=-1===p.indexOf(d))&&(d=p[0],f+="Z")}for(d=0;d<t.paths.length;d++)f+=i.smoothclosed(t.paths[d],t.smoothing);return f}function x(t,e,r,n){var i=e.width/2,o=e.height/2,l=t.x,s=t.y,c=t.theta,u=Math.cos(c)*i,f=Math.sin(c)*i,d=(l>n.center?n.right-l:l-n.left)/(u+Math.abs(Math.sin(c)*o)),p=(s>n.middle?n.bottom-s:s-n.top)/(Math.abs(f)+Math.cos(c)*o);if(d<1||p<1)return 1/0;var h=m.EDGECOST*(1/(d-1)+1/(p-1));h+=m.ANGLECOST*c*c;for(var g=l-u,v=s-f,y=l+u,x=s+f,b=0;b<r.length;b++){var _=r[b],w=Math.cos(_.theta)*_.width/2,T=Math.sin(_.theta)*_.width/2,k=2*a.segmentDistance(g,v,y,x,_.x-w,_.y-T,_.x+w,_.y+T)/(e.height+_.height),M=_.level===e.level,A=M?m.SAMELEVELDISTANCE:1;if(k<=A)return 1/0;h+=m.NEIGHBORCOST*(M?m.SAMELEVELFACTOR:1)/(k-A)}return h}function b(t){var e,r,n=t.trace._emptypoints,a=[],i=t.z.length,o=t.z[0].length,l=[];for(e=0;e<o;e++)l.push(1);for(e=0;e<i;e++)a.push(l.slice());for(e=0;e<n.length;e++)a[(r=n[e])[0]][r[1]]=0;return t.zmask=a,a}r.plot=function(t,e,o,l){var s=e.xaxis,c=e.yaxis;a.makeTraceGroups(l,o,"contour").each((function(o){var l=n.select(this),m=o[0],x=m.trace,_=m.x,w=m.y,T=x.contours,k=p(T,e,m),M=a.ensureSingle(l,"g","heatmapcoloring"),A=[];"heatmap"===T.coloring&&(A=[o]),u(t,e,A,M),f(k),d(k);var L=s.c2p(_[0],!0),S=s.c2p(_[_.length-1],!0),C=c.c2p(w[0],!0),O=c.c2p(w[w.length-1],!0),D=[[L,O],[S,O],[S,C],[L,C]],z=k;"constraint"===T.type&&(z=h(k,T._operation)),function(t,e,r){var n=a.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"===r.coloring?[0]:[]);n.enter().append("path"),n.exit().remove(),n.attr("d","M"+e.join("L")+"Z").style("stroke","none")}(l,D,T),function(t,e,r,i){var o="fill"===i.coloring||"constraint"===i.type&&"="!==i._operation,l="M"+r.join("L")+"Z";o&&g(e,i);var s=a.ensureSingle(t,"g","contourfill").selectAll("path").data(o?e:[]);s.enter().append("path"),s.exit().remove(),s.each((function(t){var e=(t.prefixBoundary?l:"")+y(t,r);e?n.select(this).attr("d",e).style("stroke","none"):n.select(this).remove()}))}(l,z,D,T),function(t,e,o,l,s){var c=a.ensureSingle(t,"g","contourlines"),u=!1!==s.showlines,f=s.showlabels,d=u&&f,p=r.createLines(c,u||f,e),h=r.createLineClip(c,d,o,l.trace.uid),g=t.selectAll("g.contourlabels").data(f?[0]:[]);if(g.exit().remove(),g.enter().append("g").classed("contourlabels",!0),f){var m=[],y=[];a.clearLocationCache();var x=r.labelFormatter(o,l),b=i.tester.append("text").attr("data-notex",1).call(i.font,s.labelfont),_=e[0].xaxis,w=e[0].yaxis,T=_._length,k=w._length,M=_.range,A=w.range,L=a.aggNums(Math.min,null,l.x),S=a.aggNums(Math.max,null,l.x),C=a.aggNums(Math.min,null,l.y),O=a.aggNums(Math.max,null,l.y),D=Math.max(_.c2p(L,!0),0),z=Math.min(_.c2p(S,!0),T),P=Math.max(w.c2p(O,!0),0),E=Math.min(w.c2p(C,!0),k),I={};M[0]<M[1]?(I.left=D,I.right=z):(I.left=z,I.right=D),A[0]<A[1]?(I.top=P,I.bottom=E):(I.top=E,I.bottom=P),I.middle=(I.top+I.bottom)/2,I.center=(I.left+I.right)/2,m.push([[I.left,I.top],[I.right,I.top],[I.right,I.bottom],[I.left,I.bottom]]);var R=Math.sqrt(T*T+k*k),F=v.LABELDISTANCE*R/Math.max(1,e.length/v.LABELINCREASE);p.each((function(t){var e=r.calcTextOpts(t.level,x,b,o);n.select(this).selectAll("path").each((function(){var t=a.getVisibleSegment(this,I,e.height/2);if(t&&!(t.len<(e.width+e.height)*v.LABELMIN))for(var n=Math.min(Math.ceil(t.len/F),v.LABELMAX),i=0;i<n;i++){var o=r.findBestTextLocation(this,t,e,y,I);if(!o)break;r.addLabelData(o,e,y,m)}}))})),b.remove(),r.drawLabels(g,y,o,h,d?m:null)}f&&!u&&p.remove()}(l,k,t,m,T),function(t,e,r,n,o){var l=n.trace,s=r._fullLayout._clips,c="clip"+l.uid,u=s.selectAll("#"+c).data(l.connectgaps?[]:[0]);if(u.enter().append("clipPath").classed("contourclip",!0).attr("id",c),u.exit().remove(),!1===l.connectgaps){var p={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:e.xaxis,yaxis:e.yaxis,x:n.x,y:n.y,z:b(n),smoothing:0};f([p]),d([p]),g([p],{type:"levels"}),a.ensureSingle(u,"path","").attr("d",(p.prefixBoundary?"M"+o.join("L")+"Z":"")+y(p,o))}else c=null;i.setClipUrl(t,c,r)}(l,e,t,m,D)}))},r.createLines=function(t,e,r){var n=r[0].smoothing,a=t.selectAll("g.contourlevel").data(e?r:[]);if(a.exit().remove(),a.enter().append("g").classed("contourlevel",!0),e){var o=a.selectAll("path.openline").data((function(t){return t.pedgepaths||t.edgepaths}));o.exit().remove(),o.enter().append("path").classed("openline",!0),o.attr("d",(function(t){return i.smoothopen(t,n)})).style("stroke-miterlimit",1).style("vector-effect","non-scaling-stroke");var l=a.selectAll("path.closedline").data((function(t){return t.ppaths||t.paths}));l.exit().remove(),l.enter().append("path").classed("closedline",!0),l.attr("d",(function(t){return i.smoothclosed(t,n)})).style("stroke-miterlimit",1).style("vector-effect","non-scaling-stroke")}return a},r.createLineClip=function(t,e,r,n){var a=e?"clipline"+n:null,o=r._fullLayout._clips.selectAll("#"+a).data(e?[0]:[]);return o.exit().remove(),o.enter().append("clipPath").classed("contourlineclip",!0).attr("id",a),i.setClipUrl(t,a,r),o},r.labelFormatter=function(t,e){var r=t._fullLayout,n=e.trace,a=n.contours,i={type:"linear",_id:"ycontour",showexponent:"all",exponentformat:"B"};if(a.labelformat)i.tickformat=a.labelformat,c(i,r);else{var l=o.extractOpts(n);if(l&&l.colorbar&&l.colorbar._axis)i=l.colorbar._axis;else{if("constraint"===a.type){var u=a.value;Array.isArray(u)?i.range=[u[0],u[u.length-1]]:i.range=[u,u]}else i.range=[a.start,a.end],i.nticks=(a.end-a.start)/a.size;i.range[0]===i.range[1]&&(i.range[1]+=i.range[0]||1),i.nticks||(i.nticks=1e3),c(i,r),s.prepTicks(i),i._tmin=null,i._tmax=null}}return function(t){return s.tickText(i,t).text}},r.calcTextOpts=function(t,e,r,n){var a=e(t);r.text(a).call(l.convertToTspans,n);var o=r.node(),s=i.bBox(o,!0);return{text:a,width:s.width,height:s.height,fontSize:+o.style["font-size"].replace("px",""),level:t,dy:(s.top+s.bottom)/2}},r.findBestTextLocation=function(t,e,r,n,i){var o,l,s,c,u,f=r.width;e.isClosed?(l=e.len/m.INITIALSEARCHPOINTS,o=e.min+l/2,s=e.max):(l=(e.len-f)/(m.INITIALSEARCHPOINTS+1),o=e.min+l+f/2,s=e.max-(l+f)/2);for(var d=1/0,p=0;p<m.ITERATIONS;p++){for(var h=o;h<s;h+=l){var g=a.getTextLocation(t,e.total,h,f),v=x(g,r,n,i);v<d&&(d=v,u=g,c=h)}if(d>2*m.MAXCOST)break;p&&(l/=2),s=(o=c-l/2)+1.5*l}if(d<=m.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var a=e.fontSize,i=e.width+a/3,o=Math.max(0,e.height-a/3),l=t.x,s=t.y,c=t.theta,u=Math.sin(c),f=Math.cos(c),d=function(t,e){return[l+t*f-e*u,s+t*u+e*f]},p=[d(-i/2,-o/2),d(-i/2,o/2),d(i/2,o/2),d(i/2,-o/2)];r.push({text:e.text,x:l,y:s,dy:e.dy,theta:c,level:e.level,width:i,height:o}),n.push(p)},r.drawLabels=function(t,e,r,i,o){var s=t.selectAll("text").data(e,(function(t){return t.text+","+t.x+","+t.y+","+t.theta}));if(s.exit().remove(),s.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(t){var e=t.x+Math.sin(t.theta)*t.dy,a=t.y-Math.cos(t.theta)*t.dy;n.select(this).text(t.text).attr({x:e,y:a,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+a+")"}).call(l.convertToTspans,r)})),o){for(var c="",u=0;u<o.length;u++)c+="M"+o[u].join("L")+"Z";a.ensureSingle(i,"path","").attr("d",c)}}},{"../../components/colorscale":117,"../../components/drawing":127,"../../lib":233,"../../lib/svg_text_utils":255,"../../plots/cartesian/axes":279,"../../plots/cartesian/set_convert":299,"../heatmap/plot":398,"./close_boundaries":367,"./constants":369,"./convert_to_constraints":373,"./empty_pathinfo":375,"./find_all_paths":377,"./make_crossings":382,d3:21}],384:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib");function i(t,e,r){var a={type:"linear",range:[t,e]};return n.autoTicks(a,(e-t)/(r||15)),a}e.exports=function(t,e){var r=t.contours;if(t.autocontour){var o=t.zmin,l=t.zmax;(t.zauto||void 0===o)&&(o=a.aggNums(Math.min,null,e)),(t.zauto||void 0===l)&&(l=a.aggNums(Math.max,null,e));var s=i(o,l,t.ncontours);r.size=s.dtick,r.start=n.tickFirst(s),s.range.reverse(),r.end=n.tickFirst(s),r.start===o&&(r.start+=r.size),r.end===l&&(r.end-=r.size),r.start>r.end&&(r.start=r.end=(r.start+r.end)/2),t._input.contours||(t._input.contours={}),a.extendFlat(t._input.contours,{start:r.start,end:r.end,size:r.size}),t._input.autocontour=!0}else if("constraint"!==r.type){var c,u=r.start,f=r.end,d=t._input.contours;if(u>f&&(r.start=d.start=f,f=r.end=d.end=u,u=r.start),!(r.size>0))c=u===f?1:i(u,f,t.ncontours).dtick,d.size=r.size=c}}},{"../../lib":233,"../../plots/cartesian/axes":279}],385:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),i=t("../heatmap/style"),o=t("./make_color_map");e.exports=function(t){var e=n.select(t).selectAll("g.contour");e.style("opacity",(function(t){return t[0].trace.opacity})),e.each((function(t){var e=n.select(this),r=t[0].trace,i=r.contours,l=r.line,s=i.size||1,c=i.start,u="constraint"===i.type,f=!u&&"lines"===i.coloring,d=!u&&"fill"===i.coloring,p=f||d?o(r):null;e.selectAll("g.contourlevel").each((function(t){n.select(this).selectAll("path").call(a.lineGroupStyle,l.width,f?p(t.level):l.color,l.dash)}));var h=i.labelfont;if(e.selectAll("g.contourlabels text").each((function(t){a.font(n.select(this),{family:h.family,size:h.size,color:h.color||(f?p(t.level):l.color)})})),u)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(d){var g;e.selectAll("g.contourfill path").style("fill",(function(t){return void 0===g&&(g=t.level),p(t.level+.5*s)})),void 0===g&&(g=c),e.selectAll("g.contourbg path").style("fill",p(g-.5*s))}})),i(t)}},{"../../components/drawing":127,"../heatmap/style":399,"./make_color_map":381,d3:21}],386:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),a=t("./label_defaults");e.exports=function(t,e,r,i,o){var l,s=r("contours.coloring"),c="";"fill"===s&&(l=r("contours.showlines")),!1!==l&&("lines"!==s&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==s&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,i,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),a(r,i,c,o)}},{"../../components/colorscale/defaults":115,"./label_defaults":380}],387:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../plots/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../components/colorscale/attributes"),l=(t("../../constants/docs").FORMAT_LINK,t("../../lib/extend").extendFlat);e.exports=l({z:{valType:"data_array",editType:"calc"},x:l({},n.x,{impliedEdits:{xtype:"array"}}),x0:l({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:l({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:l({},n.y,{impliedEdits:{ytype:"array"}}),y0:l({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:l({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:l({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:l({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:l({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:l({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:l({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:l({},n.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},zhoverformat:{valType:"string",dflt:"",editType:"none"},hovertemplate:i(),showlegend:l({},a.showlegend,{dflt:!1})},{transforms:void 0},o("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":112,"../../constants/docs":209,"../../lib/extend":227,"../../plots/attributes":275,"../../plots/template_attributes":321,"../scatter/attributes":447}],388:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/align_period"),l=t("../histogram2d/calc"),s=t("../../components/colorscale/calc"),c=t("./convert_column_xyz"),u=t("./clean_2d_array"),f=t("./interp2d"),d=t("./find_empties"),p=t("./make_bound_array"),h=t("../../constants/numerical").BADNUM;function g(t){for(var e=[],r=t.length,n=0;n<r;n++){var a=t[n];a!==h&&e.push(a)}return e}e.exports=function(t,e){var r,v,m,y,x,b,_,w,T,k,M,A=i.getFromId(t,e.xaxis||"x"),L=i.getFromId(t,e.yaxis||"y"),S=n.traceIs(e,"contour"),C=n.traceIs(e,"histogram"),O=n.traceIs(e,"gl2d"),D=S?"best":e.zsmooth;if(A._minDtick=0,L._minDtick=0,C)y=(M=l(t,e)).orig_x,r=M.x,v=M.x0,m=M.dx,w=M.orig_y,x=M.y,b=M.y0,_=M.dy,T=M.z;else{var z=e.z;a.isArray1D(z)?(c(e,A,L,"x","y",["z"]),r=e._x,x=e._y,z=e._z):(y=e.x?A.makeCalcdata(e,"x"):[],w=e.y?L.makeCalcdata(e,"y"):[],r=o(e,A,"x",y),x=o(e,L,"y",w),e._x=r,e._y=x),v=e.x0,m=e.dx,b=e.y0,_=e.dy,T=u(z,e,A,L)}function P(t){D=e._input.zsmooth=e.zsmooth=!1,a.warn('cannot use zsmooth: "fast": '+t)}if((A.rangebreaks||L.rangebreaks)&&(T=function(t,e,r){for(var n=[],a=-1,i=0;i<r.length;i++)if(e[i]!==h){a++,n[a]=[];for(var o=0;o<r[i].length;o++)t[o]!==h&&n[a].push(r[i][o])}return n}(r,x,T),C||(r=g(r),x=g(x),e._x=r,e._y=x)),C||!S&&!e.connectgaps||(e._emptypoints=d(T),f(T,e._emptypoints)),"fast"===D)if("log"===A.type||"log"===L.type)P("log axis found");else if(!C){if(r.length){var E=(r[r.length-1]-r[0])/(r.length-1),I=Math.abs(E/100);for(k=0;k<r.length-1;k++)if(Math.abs(r[k+1]-r[k]-E)>I){P("x scale is not linear");break}}if(x.length&&"fast"===D){var R=(x[x.length-1]-x[0])/(x.length-1),F=Math.abs(R/100);for(k=0;k<x.length-1;k++)if(Math.abs(x[k+1]-x[k]-R)>F){P("y scale is not linear");break}}}var N=a.maxRowLength(T),B="scaled"===e.xtype?"":r,H=p(e,B,v,m,N,A),j="scaled"===e.ytype?"":x,U=p(e,j,b,_,T.length,L);O||(e._extremes[A._id]=i.findExtremes(A,H),e._extremes[L._id]=i.findExtremes(L,U));var V={x:H,y:U,z:T,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(e.xperiodalignment&&y&&(V.orig_x=y),e.yperiodalignment&&w&&(V.orig_y=w),B&&B.length===H.length-1&&(V.xCenter=B),j&&j.length===U.length-1&&(V.yCenter=j),C&&(V.xRanges=M.xRanges,V.yRanges=M.yRanges,V.pts=M.pts),S||s(t,e,{vals:T,cLetter:"z"}),S&&e.contours&&"heatmap"===e.contours.coloring){var q={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};V.xfill=p(q,B,v,m,N,A),V.yfill=p(q,j,b,_,T.length,L)}return[V]}},{"../../components/colorscale/calc":113,"../../constants/numerical":212,"../../lib":233,"../../plots/cartesian/align_period":276,"../../plots/cartesian/axes":279,"../../registry":326,"../histogram2d/calc":416,"./clean_2d_array":389,"./convert_column_xyz":391,"./find_empties":393,"./interp2d":396,"./make_bound_array":397}],389:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var l,s,c,u,f,d;function p(t){if(n(t))return+t}if(e&&e.transpose){for(l=0,f=0;f<t.length;f++)l=Math.max(l,t[f].length);if(0===l)return!1;c=function(t){return t.length},u=function(t,e,r){return(t[r]||[])[e]}}else l=t.length,c=function(t,e){return t[e].length},u=function(t,e,r){return(t[e]||[])[r]};var h=function(t,e,r){return e===i||r===i?i:u(t,e,r)};function g(t){if(e&&"carpet"!==e.type&&"contourcarpet"!==e.type&&t&&"category"===t.type&&e["_"+t._id.charAt(0)].length){var r=t._id.charAt(0),n={},o=e["_"+r+"CategoryMap"]||e[r];for(f=0;f<o.length;f++)n[o[f]]=f;return function(e){var r=n[t._categories[e]];return r+1?r:i}}return a.identity}var v=g(r),m=g(o);o&&"category"===o.type&&(l=o._categories.length);var y=new Array(l);for(f=0;f<l;f++)for(s=r&&"category"===r.type?r._categories.length:c(t,f),y[f]=new Array(s),d=0;d<s;d++)y[f][d]=p(h(t,m(f),v(d)));return y}},{"../../constants/numerical":212,"../../lib":233,"fast-isnumeric":23}],390:[function(t,e,r){"use strict";e.exports={min:"zmin",max:"zmax"}},{}],391:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../constants/numerical").BADNUM,i=t("../../plots/cartesian/align_period");e.exports=function(t,e,r,o,l,s){var c=t._length,u=e.makeCalcdata(t,o),f=r.makeCalcdata(t,l);u=i(t,e,o,u),f=i(t,r,l,f);var d,p,h,g,v=t.text,m=void 0!==v&&n.isArray1D(v),y=t.hovertext,x=void 0!==y&&n.isArray1D(y),b=n.distinctVals(u),_=b.vals,w=n.distinctVals(f),T=w.vals,k=[],M=T.length,A=_.length;for(d=0;d<s.length;d++)k[d]=n.init2dArray(M,A);m&&(h=n.init2dArray(M,A)),x&&(g=n.init2dArray(M,A));var L=n.init2dArray(M,A);for(d=0;d<c;d++)if(u[d]!==a&&f[d]!==a){var S=n.findBin(u[d]+b.minDiff/2,_),C=n.findBin(f[d]+w.minDiff/2,T);for(p=0;p<s.length;p++){var O=t[s[p]];k[p][C][S]=O[d],L[C][S]=d}m&&(h[C][S]=v[d]),x&&(g[C][S]=y[d])}for(t["_"+o]=_,t["_"+l]=T,p=0;p<s.length;p++)t["_"+s[p]]=k[p];m&&(t._text=h),x&&(t._hovertext=g),e&&"category"===e.type&&(t["_"+o+"CategoryMap"]=_.map((function(t){return e._categories[t]}))),r&&"category"===r.type&&(t["_"+l+"CategoryMap"]=T.map((function(t){return r._categories[t]}))),t._after2before=L}},{"../../constants/numerical":212,"../../lib":233,"../../plots/cartesian/align_period":276}],392:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./xyz_defaults"),i=t("../scatter/period_defaults"),o=t("./style_defaults"),l=t("../../components/colorscale/defaults"),s=t("./attributes");e.exports=function(t,e,r,c){function u(r,a){return n.coerce(t,e,s,r,a)}a(t,e,u,c)?(i(t,e,c,u),u("text"),u("hovertext"),u("hovertemplate"),o(t,e,u,c),u("hoverongaps"),u("connectgaps",n.isArray1D(e.z)&&!1!==e.zsmooth),l(t,e,c,u,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":115,"../../lib":233,"../scatter/period_defaults":467,"./attributes":387,"./style_defaults":400,"./xyz_defaults":401}],393:[function(t,e,r){"use strict";var n=t("../../lib").maxRowLength;e.exports=function(t){var e,r,a,i,o,l,s,c,u=[],f={},d=[],p=t[0],h=[],g=[0,0,0],v=n(t);for(r=0;r<t.length;r++)for(e=h,h=p,p=t[r+1]||[],a=0;a<v;a++)void 0===h[a]&&((l=(void 0!==h[a-1]?1:0)+(void 0!==h[a+1]?1:0)+(void 0!==e[a]?1:0)+(void 0!==p[a]?1:0))?(0===r&&l++,0===a&&l++,r===t.length-1&&l++,a===h.length-1&&l++,l<4&&(f[[r,a]]=[r,a,l]),u.push([r,a,l])):d.push([r,a]));for(;d.length;){for(s={},c=!1,o=d.length-1;o>=0;o--)(l=((f[[(r=(i=d[o])[0])-1,a=i[1]]]||g)[2]+(f[[r+1,a]]||g)[2]+(f[[r,a-1]]||g)[2]+(f[[r,a+1]]||g)[2])/20)&&(s[i]=[r,a,l],d.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(i in s)f[i]=s[i],u.push(s[i])}return u.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":233}],394:[function(t,e,r){"use strict";var n=t("../../components/fx"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../../components/colorscale").extractOpts;e.exports=function(t,e,r,l,s,c){var u,f,d,p,h=t.cd[0],g=h.trace,v=t.xa,m=t.ya,y=h.x,x=h.y,b=h.z,_=h.xCenter,w=h.yCenter,T=h.zmask,k=g.zhoverformat,M=y,A=x;if(!1!==t.index){try{d=Math.round(t.index[1]),p=Math.round(t.index[0])}catch(e){return void a.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(d<0||d>=b[0].length||p<0||p>b.length)return}else{if(n.inbox(e-y[0],e-y[y.length-1],0)>0||n.inbox(r-x[0],r-x[x.length-1],0)>0)return;if(c){var L;for(M=[2*y[0]-y[1]],L=1;L<y.length;L++)M.push((y[L]+y[L-1])/2);for(M.push([2*y[y.length-1]-y[y.length-2]]),A=[2*x[0]-x[1]],L=1;L<x.length;L++)A.push((x[L]+x[L-1])/2);A.push([2*x[x.length-1]-x[x.length-2]])}d=Math.max(0,Math.min(M.length-2,a.findBin(e,M))),p=Math.max(0,Math.min(A.length-2,a.findBin(r,A)))}var S,C,O=v.c2p(y[d]),D=v.c2p(y[d+1]),z=m.c2p(x[p]),P=m.c2p(x[p+1]);c?(S=h.orig_x||y,C=h.orig_y||x,D=O,u=S[d],P=z,f=C[p]):(S=h.orig_x||_||y,C=h.orig_y||w||x,u=_?S[d]:(S[d]+S[d+1])/2,f=w?C[p]:(C[p]+C[p+1])/2,v&&"category"===v.type&&(u=y[d]),m&&"category"===m.type&&(f=x[p]),g.zsmooth&&(O=D=v.c2p(u),z=P=m.c2p(f)));var E=b[p][d];if(T&&!T[p][d]&&(E=void 0),void 0!==E||g.hoverongaps){var I;Array.isArray(h.hovertext)&&Array.isArray(h.hovertext[p])?I=h.hovertext[p][d]:Array.isArray(h.text)&&Array.isArray(h.text[p])&&(I=h.text[p][d]);var R=o(g),F={type:"linear",range:[R.min,R.max],hoverformat:k,_separators:v._separators,_numFormat:v._numFormat},N=i.tickText(F,E,"hover").text;return[a.extendFlat(t,{index:g._after2before?g._after2before[p][d]:[p,d],distance:t.maxHoverDistance,spikeDistance:t.maxSpikeDistance,x0:O,x1:D,y0:z,y1:P,xLabelVal:u,yLabelVal:f,zLabelVal:E,zLabel:N,text:I})]}}},{"../../components/colorscale":117,"../../components/fx":145,"../../lib":233,"../../plots/cartesian/axes":279}],395:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:t("./colorbar"),style:t("./style"),hoverPoints:t("./hover"),moduleType:"trace",name:"heatmap",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}},{"../../plots/cartesian":292,"./attributes":387,"./calc":388,"./colorbar":390,"./defaults":392,"./hover":394,"./plot":398,"./style":399}],396:[function(t,e,r){"use strict";var n=t("../../lib"),a=[[-1,0],[1,0],[0,-1],[0,1]];function i(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,i,o,l,s,c,u,f,d,p,h,g,v,m=0;for(l=0;l<e.length;l++){for(i=(n=e[l])[0],o=n[1],h=t[i][o],p=0,d=0,s=0;s<4;s++)(u=t[i+(c=a[s])[0]])&&void 0!==(f=u[o+c[1]])&&(0===p?g=v=f:(g=Math.min(g,f),v=Math.max(v,f)),d++,p+=f);if(0===d)throw"iterateInterp2d order is wrong: no defined neighbors";t[i][o]=p/d,void 0===h?d<4&&(m=1):(t[i][o]=(1+r)*t[i][o]-r*h,v>g&&(m=Math.max(m,Math.abs(t[i][o]-h)/(v-g))))}return m}e.exports=function(t,e){var r,a=1;for(o(t,e),r=0;r<e.length&&!(e[r][2]<4);r++);for(e=e.slice(r),r=0;r<100&&a>.01;r++)a=o(t,e,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),t}},{"../../lib":233}],397:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i,o,l){var s,c,u,f=[],d=n.traceIs(t,"contour"),p=n.traceIs(t,"histogram"),h=n.traceIs(t,"gl2d");if(a(e)&&e.length>1&&!p&&"category"!==l.type){var g=e.length;if(!(g<=o))return d?e.slice(0,o):e.slice(0,o+1);if(d||h)f=e.slice(0,o);else if(1===o)f=[e[0]-.5,e[0]+.5];else{for(f=[1.5*e[0]-.5*e[1]],u=1;u<g;u++)f.push(.5*(e[u-1]+e[u]));f.push(1.5*e[g-1]-.5*e[g-2])}if(g<o){var v=f[f.length-1],m=v-f[f.length-2];for(u=g;u<o;u++)v+=m,f.push(v)}}else{var y=t[l._id.charAt(0)+"calendar"];if(p)s=l.r2c(r,0,y);else if(a(e)&&1===e.length)s=e[0];else if(void 0===r)s=0;else{s=("log"===l.type?l.d2c:l.r2c)(r,0,y)}for(c=i||1,u=d||h?0:-.5;u<o;u++)f.push(s+c*u)}return f}},{"../../lib":233,"../../registry":326}],398:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("../../registry"),o=t("../../lib"),l=t("../../components/colorscale").makeColorScaleFuncFromTrace,s=t("../../constants/xmlns_namespaces");function c(t,e){var r=e.length-2,n=o.constrain(o.findBin(t,e),0,r),a=e[n],i=e[n+1],l=o.constrain(n+(t-a)/(i-a)-.5,0,r),s=Math.round(l),c=Math.abs(l-s);return l&&l!==r&&c?{bin0:s,frac:c,bin1:Math.round(s+c/(l-s))}:{bin0:s,bin1:s,frac:0}}function u(t,e){var r=e.length-1,n=o.constrain(o.findBin(t,e),0,r),a=e[n],i=(t-a)/(e[n+1]-a)||0;return i<=0?{bin0:n,bin1:n,frac:0}:i<.5?{bin0:n,bin1:n+1,frac:i}:{bin0:n+1,bin1:n,frac:1-i}}function f(t,e,r){t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=Math.round(255*r[3])}e.exports=function(t,e,r,d){var p=e.xaxis,h=e.yaxis;o.makeTraceGroups(d,r,"hm").each((function(e){var r,d,g,v,m,y,x=n.select(this),b=e[0],_=b.trace,w=b.z,T=b.x,k=b.y,M=b.xCenter,A=b.yCenter,L=i.traceIs(_,"contour"),S=L?"best":_.zsmooth,C=w.length,O=o.maxRowLength(w),D=!1,z=!1;for(y=0;void 0===r&&y<T.length-1;)r=p.c2p(T[y]),y++;for(y=T.length-1;void 0===d&&y>0;)d=p.c2p(T[y]),y--;for(d<r&&(g=d,d=r,r=g,D=!0),y=0;void 0===v&&y<k.length-1;)v=h.c2p(k[y]),y++;for(y=k.length-1;void 0===m&&y>0;)m=h.c2p(k[y]),y--;if(m<v&&(g=v,v=m,m=g,z=!0),L&&(M=T,A=k,T=b.xfill,k=b.yfill),"fast"!==S){var P="best"===S?0:.5;r=Math.max(-P*p._length,r),d=Math.min((1+P)*p._length,d),v=Math.max(-P*h._length,v),m=Math.min((1+P)*h._length,m)}var E=Math.round(d-r),I=Math.round(m-v);if(E<=0||I<=0){x.selectAll("image").data([]).exit().remove()}else{var R,F;"fast"===S?(R=O,F=C):(R=E,F=I);var N=document.createElement("canvas");N.width=R,N.height=F;var B,H,j=N.getContext("2d"),U=l(_,{noNumericCheck:!0,returnArray:!0});"fast"===S?(B=D?function(t){return O-1-t}:o.identity,H=z?function(t){return C-1-t}:o.identity):(B=function(t){return o.constrain(Math.round(p.c2p(T[t])-r),0,E)},H=function(t){return o.constrain(Math.round(h.c2p(k[t])-v),0,I)});var V,q,G,Z,Y,X=H(0),W=[X,X],Q=D?0:1,J=z?0:1,$=0,K=0,tt=0,et=0;if(S){var rt,nt=0;try{rt=new Uint8Array(E*I*4)}catch(t){rt=new Array(E*I*4)}if("best"===S){var at,it,ot,lt=M||T,st=A||k,ct=new Array(lt.length),ut=new Array(st.length),ft=new Array(E),dt=M?u:c,pt=A?u:c;for(y=0;y<lt.length;y++)ct[y]=Math.round(p.c2p(lt[y])-r);for(y=0;y<st.length;y++)ut[y]=Math.round(h.c2p(st[y])-v);for(y=0;y<E;y++)ft[y]=dt(y,ct);for(q=0;q<I;q++)for(it=w[(at=pt(q,ut)).bin0],ot=w[at.bin1],y=0;y<E;y++,nt+=4)f(rt,nt,Y=kt(it,ot,ft[y],at))}else for(q=0;q<C;q++)for(Z=w[q],W=H(q),y=0;y<E;y++)Y=Tt(Z[y],1),f(rt,nt=4*(W*E+B(y)),Y);var ht=j.createImageData(E,I);try{ht.data.set(rt)}catch(t){var gt=ht.data,vt=gt.length;for(q=0;q<vt;q++)gt[q]=rt[q]}j.putImageData(ht,0,0)}else{var mt=_.xgap,yt=_.ygap,xt=Math.floor(mt/2),bt=Math.floor(yt/2);for(q=0;q<C;q++)if(Z=w[q],W.reverse(),W[J]=H(q+1),W[0]!==W[1]&&void 0!==W[0]&&void 0!==W[1])for(V=[G=B(0),G],y=0;y<O;y++)V.reverse(),V[Q]=B(y+1),V[0]!==V[1]&&void 0!==V[0]&&void 0!==V[1]&&(Y=Tt(Z[y],(V[1]-V[0])*(W[1]-W[0])),j.fillStyle="rgba("+Y.join(",")+")",j.fillRect(V[0]+xt,W[0]+bt,V[1]-V[0]-mt,W[1]-W[0]-yt))}K=Math.round(K/$),tt=Math.round(tt/$),et=Math.round(et/$);var _t=a("rgb("+K+","+tt+","+et+")");t._hmpixcount=(t._hmpixcount||0)+$,t._hmlumcount=(t._hmlumcount||0)+$*_t.getLuminance();var wt=x.selectAll("image").data(e);wt.enter().append("svg:image").attr({xmlns:s.svg,preserveAspectRatio:"none"}),wt.attr({height:I,width:E,x:r,y:v,"xlink:href":N.toDataURL("image/png")})}function Tt(t,e){if(void 0!==t){var r=U(t);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),$+=e,K+=r[0]*e,tt+=r[1]*e,et+=r[2]*e,r}return[0,0,0,0]}function kt(t,e,r,n){var a=t[r.bin0];if(void 0===a)return Tt(void 0,1);var i,o=t[r.bin1],l=e[r.bin0],s=e[r.bin1],c=o-a||0,u=l-a||0;return i=void 0===o?void 0===s?0:void 0===l?2*(s-a):2*(2*s-l-a)/3:void 0===s?void 0===l?0:2*(2*a-o-l)/3:void 0===l?2*(2*s-o-a)/3:s+a-o-l,Tt(a+r.frac*c+n.frac*(u+r.frac*i))}}))}},{"../../components/colorscale":117,"../../constants/xmlns_namespaces":213,"../../lib":233,"../../registry":326,d3:21,tinycolor2:88}],399:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t){n.select(t).selectAll(".hm image").style("opacity",(function(t){return t.trace.opacity}))}},{d3:21}],400:[function(t,e,r){"use strict";e.exports=function(t,e,r){!1===r("zsmooth")&&(r("xgap"),r("ygap")),r("zhoverformat")}},{}],401:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../registry");function o(t,e){var r=e(t);return"scaled"===(r?e(t+"type","array"):"scaled")&&(e(t+"0"),e("d"+t)),r}e.exports=function(t,e,r,l,s,c){var u,f,d=r("z");if(s=s||"x",c=c||"y",void 0===d||!d.length)return 0;if(a.isArray1D(t.z)){u=r(s),f=r(c);var p=a.minRowLength(u),h=a.minRowLength(f);if(0===p||0===h)return 0;e._length=Math.min(p,h,d.length)}else{if(u=o(s,r),f=o(c,r),!function(t){for(var e,r=!0,i=!1,o=!1,l=0;l<t.length;l++){if(e=t[l],!a.isArrayOrTypedArray(e)){r=!1;break}e.length>0&&(i=!0);for(var s=0;s<e.length;s++)if(n(e[s])){o=!0;break}}return r&&i&&o}(d))return 0;r("transpose"),e._length=null}return"heatmapgl"===t.type||"contourgl"===t.type||i.getComponentMethod("calendars","handleTraceDefaults")(t,e,[s,c],l),!0}},{"../../lib":233,"../../registry":326,"fast-isnumeric":23}],402:[function(t,e,r){"use strict";var n=t("../bar/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("./bin_attributes"),o=t("./constants"),l=t("../../lib/extend").extendFlat;e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),orientation:n.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:i("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:i("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:a({},{keys:o.eventDataKeys}),marker:n.marker,offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,_deprecated:{bardir:n._deprecated.bardir}}},{"../../lib/extend":227,"../../plots/template_attributes":321,"../bar/attributes":336,"./bin_attributes":404,"./constants":408}],403:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=t.length,n=0,a=0;a<r;a++)e[a]?(t[a]/=e[a],n+=t[a]):t[a]=null;return n}},{}],404:[function(t,e,r){"use strict";e.exports=function(t,e){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}},{}],405:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,a){var i=a[e];return n(i)?(i=Number(i),r[t]+=i,i):0},avg:function(t,e,r,a,i){var o=a[e];return n(o)&&(o=Number(o),r[t]+=o,i[t]++),0},min:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]>i){var o=i-r[t];return r[t]=i,o}}return 0},max:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]<i){var o=i-r[t];return r[t]=i,o}}return 0}}},{"fast-isnumeric":23}],406:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.ONEAVGYEAR,i=n.ONEAVGMONTH,o=n.ONEDAY,l=n.ONEHOUR,s=n.ONEMIN,c=n.ONESEC,u=t("../../plots/cartesian/axes").tickIncrement;function f(t,e,r,n){if(t*e<=0)return 1/0;for(var a=Math.abs(e-t),i="date"===r.type,o=d(a,i),l=0;l<10;l++){var s=d(80*o,i);if(o===s)break;if(!p(s,t,e,i,r,n))break;o=s}return o}function d(t,e){return e&&t>c?t>o?t>1.1*a?a:t>1.1*i?i:o:t>l?l:t>s?s:c:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function p(t,e,r,n,i,l){if(n&&t>o){var s=h(e,i,l),c=h(r,i,l),u=t===a?0:1;return s[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function h(t,e,r){var n=e.c2d(t,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,i){var l,s,c=-1.1*e,d=-.1*e,p=t-d,h=r[0],g=r[1],v=Math.min(f(h+d,h+p,n,i),f(g+d,g+p,n,i)),m=Math.min(f(h+c,h+d,n,i),f(g+c,g+d,n,i));if(v>m&&m<Math.abs(g-h)/4e3?(l=v,s=!1):(l=Math.min(v,m),s=!0),"date"===n.type&&l>o){var y=l===a?1:6,x=l===a?"M12":"M1";return function(e,r){var o=n.c2d(e,a,i),l=o.indexOf("-",y);l>0&&(o=o.substr(0,l));var c=n.d2c(o,0,i);if(c<e){var f=u(c,x,!1,i);(c+f)/2<e+t&&(c=f)}return r&&s?u(c,x,!0,i):c}}return function(e,r){var n=l*Math.round(e/l);return n+l/10<e&&n+.9*l<e+t&&(n+=l),r&&s&&(n-=l),n}}},{"../../constants/numerical":212,"../../plots/cartesian/axes":279}],407:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../registry"),o=t("../../plots/cartesian/axes"),l=t("../bar/arrays_to_calcdata"),s=t("./bin_functions"),c=t("./norm_functions"),u=t("./average"),f=t("./bin_label_vals");function d(t,e,r,l,s){var c,u,f,p,h,g,v,m=l+"bins",y=t._fullLayout,x=e["_"+l+"bingroup"],b=y._histogramBinOpts[x],_="overlay"===y.barmode,w=function(t){return r.r2c(t,0,p)},T=function(t){return r.c2r(t,0,p)},k="date"===r.type?function(t){return t||0===t?a.cleanDate(t,null,p):null}:function(t){return n(t)?Number(t):null};function M(t,e,r){e[t+"Found"]?(e[t]=k(e[t]),null===e[t]&&(e[t]=r[t])):(g[t]=e[t]=r[t],a.nestedProperty(u[0],m+"."+t).set(r[t]))}if(e["_"+l+"autoBinFinished"])delete e["_"+l+"autoBinFinished"];else{u=b.traces;var A=[],L=!0,S=!1,C=!1;for(c=0;c<u.length;c++)if((f=u[c]).visible){var O=b.dirs[c];h=f["_"+O+"pos0"]=r.makeCalcdata(f,O),A=a.concat(A,h),delete f["_"+l+"autoBinFinished"],!0===e.visible&&(L?L=!1:(delete f._autoBin,f["_"+l+"autoBinFinished"]=1),i.traceIs(f,"2dMap")&&(S=!0),"histogram2dcontour"===f.type&&(C=!0))}p=u[0][l+"calendar"];var D=o.autoBin(A,r,b.nbins,S,p,b.sizeFound&&b.size),z=u[0]._autoBin={};if(g=z[b.dirs[0]]={},C&&(b.size||(D.start=T(o.tickIncrement(w(D.start),D.size,!0,p))),void 0===b.end&&(D.end=T(o.tickIncrement(w(D.end),D.size,!1,p)))),_&&!i.traceIs(e,"2dMap")&&0===D._dataSpan&&"category"!==r.type&&"multicategory"!==r.type){if(s)return[D,h,!0];D=function(t,e,r,n,i){var o,l,s,c=t._fullLayout,u=function(t,e){for(var r=e.xaxis,n=e.yaxis,a=e.orientation,i=[],o=t._fullData,l=0;l<o.length;l++){var s=o[l];"histogram"===s.type&&!0===s.visible&&s.orientation===a&&s.xaxis===r&&s.yaxis===n&&i.push(s)}return i}(t,e),f=!1,p=1/0,h=[e];for(o=0;o<u.length;o++)if((l=u[o])===e)f=!0;else if(f){var g=d(t,l,r,n,!0),v=g[0],m=g[2];l["_"+n+"autoBinFinished"]=1,l["_"+n+"pos0"]=g[1],m?h.push(l):p=Math.min(p,v.size)}else s=c._histogramBinOpts[l["_"+n+"bingroup"]],p=Math.min(p,s.size||l[i].size);var y=new Array(h.length);for(o=0;o<h.length;o++)for(var x=h[o]["_"+n+"pos0"],b=0;b<x.length;b++)if(void 0!==x[b]){y[o]=x[b];break}isFinite(p)||(p=a.distinctVals(y).minDiff);for(o=0;o<h.length;o++){var _=(l=h[o])[n+"calendar"],w={start:r.c2r(y[o]-p/2,0,_),end:r.c2r(y[o]+p/2,0,_),size:p};l._input[i]=l[i]=w,(s=c._histogramBinOpts[l["_"+n+"bingroup"]])&&a.extendFlat(s,w)}return e[i]}(t,e,r,l,m)}(v=f.cumulative||{}).enabled&&"include"!==v.currentbin&&("decreasing"===v.direction?D.start=T(o.tickIncrement(w(D.start),D.size,!0,p)):D.end=T(o.tickIncrement(w(D.end),D.size,!1,p))),b.size=D.size,b.sizeFound||(g.size=D.size,a.nestedProperty(u[0],m+".size").set(D.size)),M("start",b,D),M("end",b,D)}h=e["_"+l+"pos0"],delete e["_"+l+"pos0"];var P=e._input[m]||{},E=a.extendFlat({},b),I=b.start,R=r.r2l(P.start),F=void 0!==R;if((b.startFound||F)&&R!==r.r2l(I)){var N=F?R:a.aggNums(Math.min,null,h),B={type:"category"===r.type||"multicategory"===r.type?"linear":r.type,r2l:r.r2l,dtick:b.size,tick0:I,calendar:p,range:[N,o.tickIncrement(N,b.size,!1,p)].map(r.l2r)},H=o.tickFirst(B);H>r.r2l(N)&&(H=o.tickIncrement(H,b.size,!0,p)),E.start=r.l2r(H),F||a.nestedProperty(e,m+".start").set(E.start)}var j=b.end,U=r.r2l(P.end),V=void 0!==U;if((b.endFound||V)&&U!==r.r2l(j)){var q=V?U:a.aggNums(Math.max,null,h);E.end=r.l2r(q),V||a.nestedProperty(e,m+".start").set(E.end)}var G="autobin"+l;return!1===e._input[G]&&(e._input[m]=a.extendFlat({},e[m]||{}),delete e._input[G],delete e[G]),[E,h]}e.exports={calc:function(t,e){var r,i,p,h,g=[],v=[],m=o.getFromId(t,"h"===e.orientation?e.yaxis:e.xaxis),y="h"===e.orientation?"y":"x",x={x:"y",y:"x"}[y],b=e[y+"calendar"],_=e.cumulative,w=d(t,e,m,y),T=w[0],k=w[1],M="string"==typeof T.size,A=[],L=M?A:T,S=[],C=[],O=[],D=0,z=e.histnorm,P=e.histfunc,E=-1!==z.indexOf("density");_.enabled&&E&&(z=z.replace(/ ?density$/,""),E=!1);var I,R="max"===P||"min"===P?null:0,F=s.count,N=c[z],B=!1,H=function(t){return m.r2c(t,0,b)};for(a.isArrayOrTypedArray(e[x])&&"count"!==P&&(I=e[x],B="avg"===P,F=s[P]),r=H(T.start),p=H(T.end)+(r-o.tickIncrement(r,T.size,!1,b))/1e6;r<p&&g.length<1e6&&(i=o.tickIncrement(r,T.size,!1,b),g.push((r+i)/2),v.push(R),O.push([]),A.push(r),E&&S.push(1/(i-r)),B&&C.push(0),!(i<=r));)r=i;A.push(r),M||"date"!==m.type||(L={start:H(L.start),end:H(L.end),size:L.size}),t._fullLayout._roundFnOpts||(t._fullLayout._roundFnOpts={});var j=e["_"+y+"bingroup"],U={leftGap:1/0,rightGap:1/0};j&&(t._fullLayout._roundFnOpts[j]||(t._fullLayout._roundFnOpts[j]=U),U=t._fullLayout._roundFnOpts[j]);var V,q=v.length,G=!0,Z=U.leftGap,Y=U.rightGap,X={};for(r=0;r<k.length;r++){var W=k[r];(h=a.findBin(W,L))>=0&&h<q&&(D+=F(h,r,v,I,C),G&&O[h].length&&W!==k[O[h][0]]&&(G=!1),O[h].push(r),X[r]=h,Z=Math.min(Z,W-A[h]),Y=Math.min(Y,A[h+1]-W))}U.leftGap=Z,U.rightGap=Y,G||(V=function(e,r){return function(){var n=t._fullLayout._roundFnOpts[j];return f(n.leftGap,n.rightGap,A,m,b)(e,r)}}),B&&(D=u(v,C)),N&&N(v,D,S),_.enabled&&function(t,e,r){var n,a,i;function o(e){i=t[e],t[e]/=2}function l(e){a=t[e],t[e]=i+a/2,i+=a}if("half"===r)if("increasing"===e)for(o(0),n=1;n<t.length;n++)l(n);else for(o(t.length-1),n=t.length-2;n>=0;n--)l(n);else if("increasing"===e){for(n=1;n<t.length;n++)t[n]+=t[n-1];"exclude"===r&&(t.unshift(0),t.pop())}else{for(n=t.length-2;n>=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(v,_.direction,_.currentbin);var Q=Math.min(g.length,v.length),J=[],$=0,K=Q-1;for(r=0;r<Q;r++)if(v[r]){$=r;break}for(r=Q-1;r>=$;r--)if(v[r]){K=r;break}for(r=$;r<=K;r++)if(n(g[r])&&n(v[r])){var tt={p:g[r],s:v[r],b:0};_.enabled||(tt.pts=O[r],G?tt.ph0=tt.ph1=O[r].length?k[O[r][0]]:g[r]:(e._computePh=!0,tt.ph0=V(A[r]),tt.ph1=V(A[r+1],!0))),J.push(tt)}return 1===J.length&&(J[0].width1=o.tickIncrement(J[0].p,T.size,!1,b)-J[0].p),l(J,e),a.isArrayOrTypedArray(e.selectedpoints)&&a.tagSelected(J,e,X),J},calcAllAutoBins:d}},{"../../lib":233,"../../plots/cartesian/axes":279,"../../registry":326,"../bar/arrays_to_calcdata":335,"./average":403,"./bin_functions":405,"./bin_label_vals":406,"./norm_functions":414,"fast-isnumeric":23}],408:[function(t,e,r){"use strict";e.exports={eventDataKeys:["binNumber"]}},{}],409:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axis_ids"),i=t("../../registry").traceIs,o=t("../bar/defaults").handleGroupingDefaults,l=n.nestedProperty,s=t("../../plots/cartesian/constraints").getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];e.exports=function(t,e){var r,f,d,p,h,g,v,m=e._histogramBinOpts={},y=[],x={},b=[];function _(t,e){return n.coerce(r._input,r,r._module.attributes,t,e)}function w(t){return"v"===t.orientation?"x":"y"}function T(t,r,i){var o=t.uid+"__"+i;r||(r=o);var l=function(t,r){return a.getFromTrace({_fullLayout:e},t,r).type}(t,i),s=t[i+"calendar"]||"",c=m[r],u=!0;c&&(l===c.axType&&s===c.calendar?(u=!1,c.traces.push(t),c.dirs.push(i)):(r=o,l!==c.axType&&n.warn(["Attempted to group the bins of trace",t.index,"set on a","type:"+l,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),s!==c.calendar&&n.warn(["Attempted to group the bins of trace",t.index,"set with a",s,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(m[r]={traces:[t],dirs:[i],axType:l,calendar:t[i+"calendar"]||""}),t["_"+i+"bingroup"]=r}for(h=0;h<t.length;h++)r=t[h],i(r,"histogram")&&(y.push(r),delete r._xautoBinFinished,delete r._yautoBinFinished,i(r,"2dMap")||o(r._input,r,e,_));var k=e._alignmentOpts||{};for(h=0;h<y.length;h++){if(r=y[h],d="",!i(r,"2dMap")){if(p=w(r),"group"===e.barmode&&r.alignmentgroup){var M=r[p+"axis"],A=s(e,M)+r.orientation;(k[A]||{})[r.alignmentgroup]&&(d=A)}d||"overlay"===e.barmode||(d=s(e,r.xaxis)+s(e,r.yaxis)+w(r))}d?(x[d]||(x[d]=[]),x[d].push(r)):b.push(r)}for(d in x)if(1!==(f=x[d]).length){var L=!1;for(f.length&&(r=f[0],L=_("bingroup")),d=L||d,h=0;h<f.length;h++){var S=(r=f[h])._input.bingroup;S&&S!==d&&n.warn(["Trace",r.index,"must match","within bingroup",d+".","Ignoring its bingroup:",S,"setting."].join(" ")),r.bingroup=d,T(r,d,w(r))}}else b.push(f[0]);for(h=0;h<b.length;h++){r=b[h];var C=_("bingroup");if(i(r,"2dMap"))for(v=0;v<2;v++){var O=_((p=u[v])+"bingroup",C?C+"__"+p:null);T(r,O,p)}else T(r,C,w(r))}for(d in m){var D=m[d];for(f=D.traces,g=0;g<c.length;g++){var z,P,E=c[g],I=E.name;if("nbins"!==I||!D.sizeFound){for(h=0;h<f.length;h++){if(r=f[h],p=D.dirs[h],z=E.aStr[p],void 0!==l(r._input,z).get()){D[I]=_(z),D[I+"Found"]=!0;break}(P=(r._autoBin||{})[p]||{})[I]&&l(r,z).set(P[I])}if("start"===I||"end"===I)for(;h<f.length;h++)(r=f[h])["_"+p+"bingroup"]&&_(z,(P=(r._autoBin||{})[p]||{})[I]);"nbins"!==I||D.sizeFound||D.nbinsFound||(r=f[0],D[I]=_(z))}}}}},{"../../lib":233,"../../plots/cartesian/axis_ids":282,"../../plots/cartesian/constraints":286,"../../registry":326,"../bar/defaults":340}],410:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../components/color"),o=t("../bar/style_defaults"),l=t("./attributes");e.exports=function(t,e,r,s){function c(r,n){return a.coerce(t,e,l,r,n)}var u=c("x"),f=c("y");c("cumulative.enabled")&&(c("cumulative.direction"),c("cumulative.currentbin")),c("text"),c("hovertext"),c("hovertemplate");var d=c("orientation",f&&!u?"h":"v"),p="v"===d?"x":"y",h="v"===d?"y":"x",g=u&&f?Math.min(a.minRowLength(u)&&a.minRowLength(f)):a.minRowLength(e[p]||[]);if(g){e._length=g,n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],s),e[h]&&c("histfunc"),c("histnorm"),c("autobin"+p),o(t,e,c,r,s),a.coerceSelectionMarkerOpacity(e,c);var v=(e.marker.line||{}).color,m=n.getComponentMethod("errorbars","supplyDefaults");m(t,e,v||i.defaultLine,{axis:"y"}),m(t,e,v||i.defaultLine,{axis:"x",inherit:"y"})}else e.visible=!1}},{"../../components/color":105,"../../lib":233,"../../registry":326,"../bar/style_defaults":351,"./attributes":402}],411:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,a){if(t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"zLabelVal"in e&&(t.z=e.zLabelVal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),!(r.cumulative||{}).enabled){var i,o=Array.isArray(a)?n[0].pts[a[0]][a[1]]:n[a].pts;if(t.pointNumbers=o,t.binNumber=t.pointNumber,delete t.pointNumber,delete t.pointIndex,r._indexToPoints){i=[];for(var l=0;l<o.length;l++)i=i.concat(r._indexToPoints[o[l]])}else i=o;t.pointIndices=i}return t}},{}],412:[function(t,e,r){"use strict";var n=t("../bar/hover").hoverPoints,a=t("../../plots/cartesian/axes").hoverLabelText;e.exports=function(t,e,r,i){var o=n(t,e,r,i);if(o){var l=(t=o[0]).cd[t.index],s=t.cd[0].trace;if(!s.cumulative.enabled){var c="h"===s.orientation?"y":"x";t[c+"Label"]=a(t[c+"a"],l.ph0,l.ph1)}return o}}},{"../../plots/cartesian/axes":279,"../bar/hover":343}],413:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("../bar/layout_attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),supplyLayoutDefaults:t("../bar/layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("../bar/cross_trace_calc").crossTraceCalc,plot:t("../bar/plot").plot,layerName:"barlayer",style:t("../bar/style").style,styleOnSelect:t("../bar/style").styleOnSelect,colorbar:t("../scatter/marker_colorbar"),hoverPoints:t("./hover"),selectPoints:t("../bar/select"),eventData:t("./event_data"),moduleType:"trace",name:"histogram",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}},{"../../plots/cartesian":292,"../bar/cross_trace_calc":339,"../bar/layout_attributes":345,"../bar/layout_defaults":346,"../bar/plot":347,"../bar/select":348,"../bar/style":350,"../scatter/marker_colorbar":465,"./attributes":402,"./calc":407,"./cross_trace_defaults":409,"./defaults":410,"./event_data":411,"./hover":412}],414:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,a=0;a<r;a++)t[a]*=n},probability:function(t,e){for(var r=t.length,n=0;n<r;n++)t[n]/=e},density:function(t,e,r,n){var a=t.length;n=n||1;for(var i=0;i<a;i++)t[i]*=r[i]*n},"probability density":function(t,e,r,n){var a=t.length;n&&(e/=n);for(var i=0;i<a;i++)t[i]*=r[i]/e}}},{}],415:[function(t,e,r){"use strict";var n=t("../histogram/attributes"),a=t("../histogram/bin_attributes"),i=t("../heatmap/attributes"),o=t("../../plots/attributes"),l=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../components/colorscale/attributes"),c=t("../../lib/extend").extendFlat;e.exports=c({x:n.x,y:n.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:n.histnorm,histfunc:n.histfunc,nbinsx:n.nbinsx,xbins:a("x"),nbinsy:n.nbinsy,ybins:a("y"),autobinx:n.autobinx,autobiny:n.autobiny,bingroup:c({},n.bingroup,{}),xbingroup:c({},n.bingroup,{}),ybingroup:c({},n.bingroup,{}),xgap:i.xgap,ygap:i.ygap,zsmooth:i.zsmooth,zhoverformat:i.zhoverformat,hovertemplate:l({},{keys:"z"}),showlegend:c({},o.showlegend,{dflt:!1})},s("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":112,"../../lib/extend":227,"../../plots/attributes":275,"../../plots/template_attributes":321,"../heatmap/attributes":387,"../histogram/attributes":402,"../histogram/bin_attributes":404}],416:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../histogram/bin_functions"),o=t("../histogram/norm_functions"),l=t("../histogram/average"),s=t("../histogram/bin_label_vals"),c=t("../histogram/calc").calcAllAutoBins;function u(t,e,r,n){var a,i=new Array(t);if(n)for(a=0;a<t;a++)i[a]=1/(e[a+1]-e[a]);else{var o=1/r;for(a=0;a<t;a++)i[a]=o}return i}function f(t,e){return{start:t(e.start),end:t(e.end),size:e.size}}function d(t,e,r,n,a,i){var o,l=t.length-1,c=new Array(l),u=s(r,n,t,a,i);for(o=0;o<l;o++){var f=(e||[])[o];c[o]=void 0===f?[u(t[o]),u(t[o+1],!0)]:[f,f]}return c}e.exports=function(t,e){var r,s,p,h,g=a.getFromId(t,e.xaxis),v=a.getFromId(t,e.yaxis),m=e.xcalendar,y=e.ycalendar,x=function(t){return g.r2c(t,0,m)},b=function(t){return v.r2c(t,0,y)},_=c(t,e,g,"x"),w=_[0],T=_[1],k=c(t,e,v,"y"),M=k[0],A=k[1],L=e._length;T.length>L&&T.splice(L,T.length-L),A.length>L&&A.splice(L,A.length-L);var S=[],C=[],O=[],D="string"==typeof w.size,z="string"==typeof M.size,P=[],E=[],I=D?P:w,R=z?E:M,F=0,N=[],B=[],H=e.histnorm,j=e.histfunc,U=-1!==H.indexOf("density"),V="max"===j||"min"===j?null:0,q=i.count,G=o[H],Z=!1,Y=[],X=[],W="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";W&&"count"!==j&&(Z="avg"===j,q=i[j]);var Q=w.size,J=x(w.start),$=x(w.end)+(J-a.tickIncrement(J,Q,!1,m))/1e6;for(r=J;r<$;r=a.tickIncrement(r,Q,!1,m))C.push(V),P.push(r),Z&&O.push(0);P.push(r);var K,tt=C.length,et=(r-J)/tt,rt=(K=J+et/2,g.c2r(K,0,m)),nt=M.size,at=b(M.start),it=b(M.end)+(at-a.tickIncrement(at,nt,!1,y))/1e6;for(r=at;r<it;r=a.tickIncrement(r,nt,!1,y)){S.push(C.slice()),E.push(r);var ot=new Array(tt);for(s=0;s<tt;s++)ot[s]=[];B.push(ot),Z&&N.push(O.slice())}E.push(r);var lt=S.length,st=(r-at)/lt,ct=function(t){return v.c2r(t,0,y)}(at+st/2);U&&(Y=u(C.length,I,et,D),X=u(S.length,R,st,z)),D||"date"!==g.type||(I=f(x,I)),z||"date"!==v.type||(R=f(b,R));var ut=!0,ft=!0,dt=new Array(tt),pt=new Array(lt),ht=1/0,gt=1/0,vt=1/0,mt=1/0;for(r=0;r<L;r++){var yt=T[r],xt=A[r];p=n.findBin(yt,I),h=n.findBin(xt,R),p>=0&&p<tt&&h>=0&&h<lt&&(F+=q(p,r,S[h],W,N[h]),B[h][p].push(r),ut&&(void 0===dt[p]?dt[p]=yt:dt[p]!==yt&&(ut=!1)),ft&&(void 0===pt[h]?pt[h]=xt:pt[h]!==xt&&(ft=!1)),ht=Math.min(ht,yt-P[p]),gt=Math.min(gt,P[p+1]-yt),vt=Math.min(vt,xt-E[h]),mt=Math.min(mt,E[h+1]-xt))}if(Z)for(h=0;h<lt;h++)F+=l(S[h],N[h]);if(G)for(h=0;h<lt;h++)G(S[h],F,Y,X[h]);return{x:T,xRanges:d(P,ut&&dt,ht,gt,g,m),x0:rt,dx:et,y:A,yRanges:d(E,ft&&pt,vt,mt,v,y),y0:ct,dy:st,z:S,pts:B}}},{"../../lib":233,"../../plots/cartesian/axes":279,"../histogram/average":403,"../histogram/bin_functions":405,"../histogram/bin_label_vals":406,"../histogram/calc":407,"../histogram/norm_functions":414}],417:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./sample_defaults"),i=t("../heatmap/style_defaults"),o=t("../../components/colorscale/defaults"),l=t("./attributes");e.exports=function(t,e,r,s){function c(r,a){return n.coerce(t,e,l,r,a)}a(t,e,c,s),!1!==e.visible&&(i(t,e,c,s),o(t,e,s,c,{prefix:"",cLetter:"z"}),c("hovertemplate"))}},{"../../components/colorscale/defaults":115,"../../lib":233,"../heatmap/style_defaults":400,"./attributes":415,"./sample_defaults":420}],418:[function(t,e,r){"use strict";var n=t("../heatmap/hover"),a=t("../../plots/cartesian/axes").hoverLabelText;e.exports=function(t,e,r,i,o,l){var s=n(t,e,r,i,o,l);if(s){var c=(t=s[0]).index,u=c[0],f=c[1],d=t.cd[0],p=d.xRanges[f],h=d.yRanges[u];return t.xLabel=a(t.xa,p[0],p[1]),t.yLabel=a(t.ya,h[0],h[1]),s}}},{"../../plots/cartesian/axes":279,"../heatmap/hover":394}],419:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("../histogram/cross_trace_defaults"),calc:t("../heatmap/calc"),plot:t("../heatmap/plot"),layerName:"heatmaplayer",colorbar:t("../heatmap/colorbar"),style:t("../heatmap/style"),hoverPoints:t("./hover"),eventData:t("../histogram/event_data"),moduleType:"trace",name:"histogram2d",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","2dMap","histogram","showLegend"],meta:{}}},{"../../plots/cartesian":292,"../heatmap/calc":388,"../heatmap/colorbar":390,"../heatmap/plot":398,"../heatmap/style":399,"../histogram/cross_trace_defaults":409,"../histogram/event_data":411,"./attributes":415,"./defaults":417,"./hover":418}],420:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports=function(t,e,r,i){var o=r("x"),l=r("y"),s=a.minRowLength(o),c=a.minRowLength(l);s&&c?(e._length=Math.min(s,c),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],i),(r("z")||r("marker.color"))&&r("histfunc"),r("histnorm"),r("autobinx"),r("autobiny")):e.visible=!1}},{"../../lib":233,"../../registry":326}],421:[function(t,e,r){"use strict";var n=t("../histogram2d/attributes"),a=t("../contour/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat;e.exports=o({x:n.x,y:n.y,z:n.z,marker:n.marker,histnorm:n.histnorm,histfunc:n.histfunc,nbinsx:n.nbinsx,xbins:n.xbins,nbinsy:n.nbinsy,ybins:n.ybins,autobinx:n.autobinx,autobiny:n.autobiny,bingroup:n.bingroup,xbingroup:n.xbingroup,ybingroup:n.ybingroup,autocontour:a.autocontour,ncontours:a.ncontours,contours:a.contours,line:{color:a.line.color,width:o({},a.line.width,{dflt:.5}),dash:a.line.dash,smoothing:a.line.smoothing,editType:"plot"},zhoverformat:n.zhoverformat,hovertemplate:n.hovertemplate},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":112,"../../lib/extend":227,"../contour/attributes":365,"../histogram2d/attributes":415}],422:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../histogram2d/sample_defaults"),i=t("../contour/contours_defaults"),o=t("../contour/style_defaults"),l=t("./attributes");e.exports=function(t,e,r,s){function c(r,a){return n.coerce(t,e,l,r,a)}a(t,e,c,s),!1!==e.visible&&(i(t,e,c,(function(r){return n.coerce2(t,e,l,r)})),o(t,e,c,s),c("hovertemplate"))}},{"../../lib":233,"../contour/contours_defaults":372,"../contour/style_defaults":386,"../histogram2d/sample_defaults":420,"./attributes":421}],423:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("../histogram/cross_trace_defaults"),calc:t("../contour/calc"),plot:t("../contour/plot").plot,layerName:"contourlayer",style:t("../contour/style"),colorbar:t("../contour/colorbar"),hoverPoints:t("../contour/hover"),moduleType:"trace",name:"histogram2dcontour",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}},{"../../plots/cartesian":292,"../contour/calc":366,"../contour/colorbar":368,"../contour/hover":378,"../contour/plot":383,"../contour/style":385,"../histogram/cross_trace_defaults":409,"./attributes":421,"./defaults":422}],424:[function(t,e,r){"use strict";for(var n=t("../../plots/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../lib/extend").extendFlat,o=t("./constants").colormodel,l=["rgb","rgba","rgba256","hsl","hsla"],s=[],c=[],u=0;u<l.length;u++){var f=o[l[u]];s.push("For the `"+l[u]+"` colormodel, it is ["+(f.zminDflt||f.min).join(", ")+"]."),c.push("For the `"+l[u]+"` colormodel, it is ["+(f.zmaxDflt||f.max).join(", ")+"].")}e.exports=i({source:{valType:"string",editType:"calc"},z:{valType:"data_array",editType:"calc"},colormodel:{valType:"enumerated",values:l,editType:"calc"},zmin:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},zmax:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dx:{valType:"number",dflt:1,editType:"calc"},dy:{valType:"number",dflt:1,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"data_array",editType:"plot"},hoverinfo:i({},n.hoverinfo,{flags:["x","y","z","color","name","text"],dflt:"x+y+z+text+name"}),hovertemplate:a({},{keys:["z","color","colormodel"]}),transforms:void 0})},{"../../lib/extend":227,"../../plots/attributes":275,"../../plots/template_attributes":321,"./constants":426}],425:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./constants"),i=t("fast-isnumeric"),o=t("../../plots/cartesian/axes"),l=t("../../lib").maxRowLength,s=t("./helpers").getImageSize;function c(t,e,r,a){return function(i){return n.constrain((i-t)*e,r,a)}}function u(t,e){return function(r){return n.constrain(r,t,e)}}e.exports=function(t,e){var r,n;if(e._hasZ)r=e.z.length,n=l(e.z);else if(e._hasSource){var f=s(e.source);r=f.height,n=f.width}var d,p=o.getFromId(t,e.xaxis||"x"),h=o.getFromId(t,e.yaxis||"y"),g=p.d2c(e.x0)-e.dx/2,v=h.d2c(e.y0)-e.dy/2,m=[g,g+n*e.dx],y=[v,v+r*e.dy];if(p&&"log"===p.type)for(d=0;d<n;d++)m.push(g+d*e.dx);if(h&&"log"===h.type)for(d=0;d<r;d++)y.push(v+d*e.dy);return e._extremes[p._id]=o.findExtremes(p,m),e._extremes[h._id]=o.findExtremes(h,y),e._scaler=function(t){var e=a.colormodel[t.colormodel],r=(e.colormodel||t.colormodel).length;t._sArray=[];for(var n=0;n<r;n++)e.min[n]!==t.zmin[n]||e.max[n]!==t.zmax[n]?t._sArray.push(c(t.zmin[n],(e.max[n]-e.min[n])/(t.zmax[n]-t.zmin[n]),e.min[n],e.max[n])):t._sArray.push(u(e.min[n],e.max[n]));return function(e){for(var n=e.slice(0,r),a=0;a<r;a++){var o=n[a];if(!i(o))return!1;n[a]=t._sArray[a](o)}return n}}(e),[{x0:g,y0:v,z:e.z,w:n,h:r}]}},{"../../lib":233,"../../plots/cartesian/axes":279,"./constants":426,"./helpers":429,"fast-isnumeric":23}],426:[function(t,e,r){"use strict";e.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(t){return t.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(t){var e=t.slice(0,3);return e[1]=e[1]+"%",e[2]=e[2]+"%",e},suffix:["\xb0","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(t){var e=t.slice(0,4);return e[1]=e[1]+"%",e[2]=e[2]+"%",e},suffix:["\xb0","%","%",""]}}}},{}],427:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./constants"),o=t("../../snapshot/helpers").IMAGE_URL_PREFIX;e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}r("source"),e.source&&!e.source.match(o)&&delete e.source,e._hasSource=!!e.source;var l,s=r("z");(e._hasZ=!(void 0===s||!s.length||!s[0]||!s[0].length),e._hasZ||e._hasSource)?(r("x0"),r("y0"),r("dx"),r("dy"),e._hasZ?(r("colormodel","rgb"),r("zmin",(l=i.colormodel[e.colormodel]).zminDflt||l.min),r("zmax",l.zmaxDflt||l.max)):e._hasSource&&(e.colormodel="rgba256",l=i.colormodel[e.colormodel],e.zmin=l.zminDflt,e.zmax=l.zmaxDflt),r("text"),r("hovertext"),r("hovertemplate"),e._length=null):e.visible=!1}},{"../../lib":233,"../../snapshot/helpers":330,"./attributes":424,"./constants":426}],428:[function(t,e,r){"use strict";e.exports=function(t,e){return"xVal"in e&&(t.x=e.xVal),"yVal"in e&&(t.y=e.yVal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t.color=e.color,t.colormodel=e.trace.colormodel,t.z||(t.z=e.color),t}},{}],429:[function(t,e,r){"use strict";var n=t("image-size"),a=t("../../snapshot/helpers").IMAGE_URL_PREFIX,i=t("buffer/").Buffer;r.getImageSize=function(t){var e=t.replace(a,""),r=new i(e,"base64");return n(r)}},{"../../snapshot/helpers":330,"buffer/":18,"image-size":58}],430:[function(t,e,r){"use strict";var n=t("../../components/fx"),a=t("../../lib"),i=t("./constants");e.exports=function(t,e,r){var o=t.cd[0],l=o.trace,s=t.xa,c=t.ya;if(!(n.inbox(e-o.x0,e-(o.x0+o.w*l.dx),0)>0||n.inbox(r-o.y0,r-(o.y0+o.h*l.dy),0)>0)){var u,f=Math.floor((e-o.x0)/l.dx),d=Math.floor(Math.abs(r-o.y0)/l.dy);if(l._hasZ?u=o.z[d][f]:l._hasSource&&(u=l._canvas.el.getContext("2d").getImageData(f,d,1,1).data),u){var p,h=o.hi||l.hoverinfo;if(h){var g=h.split("+");-1!==g.indexOf("all")&&(g=["color"]),-1!==g.indexOf("color")&&(p=!0)}var v,m=i.colormodel[l.colormodel],y=m.colormodel||l.colormodel,x=y.length,b=l._scaler(u),_=m.suffix,w=[];(l.hovertemplate||p)&&(w.push("["+[b[0]+_[0],b[1]+_[1],b[2]+_[2]].join(", ")),4===x&&w.push(", "+b[3]+_[3]),w.push("]"),w=w.join(""),t.extraText=y.toUpperCase()+": "+w),Array.isArray(l.hovertext)&&Array.isArray(l.hovertext[d])?v=l.hovertext[d][f]:Array.isArray(l.text)&&Array.isArray(l.text[d])&&(v=l.text[d][f]);var T=c.c2p(o.y0+(d+.5)*l.dy),k=o.x0+(f+.5)*l.dx,M=o.y0+(d+.5)*l.dy,A="["+u.slice(0,l.colormodel.length).join(", ")+"]";return[a.extendFlat(t,{index:[d,f],x0:s.c2p(o.x0+f*l.dx),x1:s.c2p(o.x0+(f+1)*l.dx),y0:T,y1:T,color:b,xVal:k,xLabelVal:k,yVal:M,yLabelVal:M,zLabelVal:A,text:v,hovertemplateLabels:{zLabel:A,colorLabel:w,"color[0]Label":b[0]+_[0],"color[1]Label":b[1]+_[1],"color[2]Label":b[2]+_[2],"color[3]Label":b[3]+_[3]}})]}}}},{"../../components/fx":145,"../../lib":233,"./constants":426}],431:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover"),eventData:t("./event_data"),moduleType:"trace",name:"image",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},{"../../plots/cartesian":292,"./attributes":424,"./calc":425,"./defaults":427,"./event_data":428,"./hover":430,"./plot":432,"./style":433}],432:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=a.strTranslate,o=t("../../constants/xmlns_namespaces"),l=t("./constants"),s=a.isIOS()||a.isSafari()||a.isIE();e.exports=function(t,e,r,c){var u=e.xaxis,f=e.yaxis,d=!(s||t._context._exportedPlot);a.makeTraceGroups(c,r,"im").each((function(e){var r=n.select(this),s=e[0],c=s.trace,p=d&&!c._hasZ&&c._hasSource&&"linear"===u.type&&"linear"===f.type;c._fastImage=p;var h,g,v,m,y,x,b=s.z,_=s.x0,w=s.y0,T=s.w,k=s.h,M=c.dx,A=c.dy;for(x=0;void 0===h&&x<T;)h=u.c2p(_+x*M),x++;for(x=T;void 0===g&&x>0;)g=u.c2p(_+x*M),x--;for(x=0;void 0===m&&x<k;)m=f.c2p(w+x*A),x++;for(x=k;void 0===y&&x>0;)y=f.c2p(w+x*A),x--;if(g<h&&(v=g,g=h,h=v),y<m&&(v=m,m=y,y=v),!p){h=Math.max(-.5*u._length,h),g=Math.min(1.5*u._length,g),m=Math.max(-.5*f._length,m),y=Math.min(1.5*f._length,y)}var L=Math.round(g-h),S=Math.round(y-m);if(L<=0||S<=0){r.selectAll("image").data([]).exit().remove()}else{var C=r.selectAll("image").data([e]);C.enter().append("svg:image").attr({xmlns:o.svg,preserveAspectRatio:"none"}),C.exit().remove();var O="image-rendering: optimizeSpeed; image-rendering: -moz-crisp-edges; image-rendering: -o-crisp-edges; image-rendering: -webkit-optimize-contrast; image-rendering: optimize-contrast; image-rendering: crisp-edges; image-rendering: pixelated;";if(p){var D=a.simpleMap(u.range,u.r2l),z=a.simpleMap(f.range,f.r2l),P=D[1]<D[0],E=z[1]>z[0];if(P||E){var I=h+L/2,R=m+S/2;O+="transform:"+i(I+"px",R+"px")+"scale("+(P?-1:1)+","+(E?-1:1)+")"+i(-I+"px",-R+"px")+";"}}C.attr("style",O);var F=new Promise((function(t){if(c._hasZ)t();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===T&&c._canvas.el.height===k&&c._canvas.source===c.source)t();else{var e=document.createElement("canvas");e.width=T,e.height=k;var r=e.getContext("2d");c._image=c._image||new Image;var n=c._image;n.onload=function(){r.drawImage(n,0,0),c._canvas={el:e,source:c.source},t()},n.setAttribute("src",c.source)}})).then((function(){var t;if(c._hasZ)t=N((function(t,e){return b[e][t]})).toDataURL("image/png");else if(c._hasSource)if(p)t=c.source;else{var e=c._canvas.el.getContext("2d").getImageData(0,0,T,k).data;t=N((function(t,r){var n=4*(r*T+t);return[e[n],e[n+1],e[n+2],e[n+3]]})).toDataURL("image/png")}C.attr({"xlink:href":t,height:S,width:L,x:h,y:m})}));t._promises.push(F)}function N(t){var e=document.createElement("canvas");e.width=L,e.height=S;var r,n=e.getContext("2d"),i=function(t){return a.constrain(Math.round(u.c2p(_+t*M)-h),0,L)},o=function(t){return a.constrain(Math.round(f.c2p(w+t*A)-m),0,S)},d=l.colormodel[c.colormodel],p=d.colormodel||c.colormodel,g=d.fmt;for(x=0;x<s.w;x++){var v=i(x),y=i(x+1);if(y!==v&&!isNaN(y)&&!isNaN(v))for(var b=0;b<s.h;b++){var T=o(b),k=o(b+1);k===T||isNaN(k)||isNaN(T)||!t(x,b)||(r=c._scaler(t(x,b)),n.fillStyle=r?p+"("+g(r).join(",")+")":"rgba(0,0,0,0)",n.fillRect(v,T,y-v,k-T))}}return e}}))}},{"../../constants/xmlns_namespaces":213,"../../lib":233,"./constants":426,d3:21}],433:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t){n.select(t).selectAll(".im image").style("opacity",(function(t){return t[0].trace.opacity}))}},{d3:21}],434:[function(t,e,r){"use strict";var n=t("../../plots/attributes"),a=t("../../plots/domain").attributes,i=t("../../plots/font_attributes"),o=t("../../components/color/attributes"),l=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/template_attributes").texttemplateAttrs,c=t("../../lib/extend").extendFlat,u=i({editType:"plot",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:c({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:l({},{keys:["label","color","value","percent","text"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:c({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:c({},u,{}),outsidetextfont:c({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:c({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:a({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:c({},u,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},{"../../components/color/attributes":104,"../../lib/extend":227,"../../plots/attributes":275,"../../plots/domain":306,"../../plots/font_attributes":307,"../../plots/template_attributes":321}],435:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="pie",r.plot=function(t,e,a,i){n.plotBasePlot(r.name,t,e,a,i)},r.clean=function(t,e,a,i){n.cleanBasePlot(r.name,t,e,a,i)}},{"../../plots/plots":313}],436:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../../components/color"),o={};function l(t){return function(e,r){return!!e&&(!!(e=a(e)).isValid()&&(e=i.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e))}}function s(t,e){var r,n=JSON.stringify(t),i=e[n];if(!i){for(i=t.slice(),r=0;r<t.length;r++)i.push(a(t[r]).lighten(20).toHexString());for(r=0;r<t.length;r++)i.push(a(t[r]).darken(20).toHexString());e[n]=i}return i}e.exports={calc:function(t,e){var r,a,i=[],o=t._fullLayout,s=o.hiddenlabels||[],c=e.labels,u=e.marker.colors||[],f=e.values,d=e._length,p=e._hasValues&&d;if(e.dlabel)for(c=new Array(d),r=0;r<d;r++)c[r]=String(e.label0+r*e.dlabel);var h={},g=l(o["_"+e.type+"colormap"]),v=0,m=!1;for(r=0;r<d;r++){var y,x,b;if(p){if(y=f[r],!n(y))continue;if((y=+y)<0)continue}else y=1;void 0!==(x=c[r])&&""!==x||(x=r);var _=h[x=String(x)];void 0===_?(h[x]=i.length,(b=-1!==s.indexOf(x))||(v+=y),i.push({v:y,label:x,color:g(u[r],x),i:r,pts:[r],hidden:b})):(m=!0,(a=i[_]).v+=y,a.pts.push(r),a.hidden||(v+=y),!1===a.color&&u[r]&&(a.color=g(u[r],x)))}return("funnelarea"===e.type?m:e.sort)&&i.sort((function(t,e){return e.v-t.v})),i[0]&&(i[0].vTotal=v),i},crossTraceCalc:function(t,e){var r=(e||{}).type;r||(r="pie");var n=t._fullLayout,a=t.calcdata,i=n[r+"colorway"],l=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(i=s(i,o));for(var c=0,u=0;u<a.length;u++){var f=a[u];if(f[0].trace.type===r)for(var d=0;d<f.length;d++){var p=f[d];!1===p.color&&(l[p.label]?p.color=l[p.label]:(l[p.label]=p.color=i[c%i.length],c++))}}},makePullColorFn:l,generateExtendedColors:s}},{"../../components/color":105,"fast-isnumeric":23,tinycolor2:88}],437:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./attributes"),o=t("../../plots/domain").defaults,l=t("../bar/defaults").handleText;function s(t,e){var r=Array.isArray(t),i=a.isArrayOrTypedArray(e),o=Math.min(r?t.length:1/0,i?e.length:1/0);if(isFinite(o)||(o=0),o&&i){for(var l,s=0;s<o;s++){var c=e[s];if(n(c)&&c>0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}e.exports={handleLabelsAndValues:s,supplyDefaults:function(t,e,r,n){function c(r,n){return a.coerce(t,e,i,r,n)}var u=s(c("labels"),c("values")),f=u.len;if(e._hasLabels=u.hasLabels,e._hasValues=u.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),f){e._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var d,p=c("text"),h=c("texttemplate");if(h||(d=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||d&&"none"!==d){var g=c("textposition");l(t,e,n,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&c("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&c("insidetextorientation")}o(e,n,c);var v=c("hole");if(c("title.text")){var m=c("title.position",v?"middle center":"top center");v||"middle center"!==m||(e.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else e.visible=!1}}},{"../../lib":233,"../../plots/domain":306,"../bar/defaults":340,"./attributes":434,"fast-isnumeric":23}],438:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,percent:t.percent,text:t.text,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),"funnelarea"===e.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":141}],439:[function(t,e,r){"use strict";var n=t("../../lib");function a(t){return-1!==t.indexOf("e")?t.replace(/[.]?0+e/,"e"):-1!==t.indexOf(".")?t.replace(/[.]?0+$/,""):t}r.formatPiePercent=function(t,e){var r=a((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=a(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r<e.length;r++){var n=t[e[r]];if(n||0===n||""===n)return n}},r.castOption=function(t,e){return Array.isArray(t)?r.getFirstFilled(t,e):t||void 0},r.getRotationAngle=function(t){return("auto"===t?0:t)*Math.PI/180}},{"../../lib":233}],440:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,supplyLayoutDefaults:t("./layout_defaults"),layoutAttributes:t("./layout_attributes"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot").plot,style:t("./style"),styleOne:t("./style_one"),moduleType:"trace",name:"pie",basePlotModule:t("./base_plot"),categories:["pie-like","pie","showLegend"],meta:{}}},{"./attributes":434,"./base_plot":435,"./calc":436,"./defaults":437,"./layout_attributes":441,"./layout_defaults":442,"./plot":443,"./style":444,"./style_one":445}],441:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],442:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}r("hiddenlabels"),r("piecolorway",e.colorway),r("extendpiecolors")}},{"../../lib":233,"./layout_attributes":441}],443:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../../components/fx"),o=t("../../components/color"),l=t("../../components/drawing"),s=t("../../lib"),c=s.strScale,u=s.strTranslate,f=t("../../lib/svg_text_utils"),d=t("../bar/uniform_text"),p=d.recordMinTextSize,h=d.clearMinTextSize,g=t("../bar/constants").TEXTPAD,v=t("./helpers"),m=t("./event_data"),y=t("../../lib").isValidTextValue;function x(t,e,r){var a=r[0],o=a.trace,l=a.cx,c=a.cy;"_hasHoverLabel"in o||(o._hasHoverLabel=!1),"_hasHoverEvent"in o||(o._hasHoverEvent=!1),t.on("mouseover",(function(t){var r=e._fullLayout,u=e._fullData[o.index];if(!e._dragging&&!1!==r.hovermode){var f=u.hoverinfo;if(Array.isArray(f)&&(f=i.castHoverinfo({hoverinfo:[v.castOption(f,t.pts)],_module:o._module},r,0)),"all"===f&&(f="label+text+value+percent+name"),u.hovertemplate||"none"!==f&&"skip"!==f&&f){var d=t.rInscribed||0,p=l+t.pxmid[0]*(1-d),h=c+t.pxmid[1]*(1-d),g=r.separators,y=[];if(f&&-1!==f.indexOf("label")&&y.push(t.label),t.text=v.castOption(u.hovertext||u.text,t.pts),f&&-1!==f.indexOf("text")){var x=t.text;s.isValidTextValue(x)&&y.push(x)}t.value=t.v,t.valueLabel=v.formatPieValue(t.v,g),f&&-1!==f.indexOf("value")&&y.push(t.valueLabel),t.percent=t.v/a.vTotal,t.percentLabel=v.formatPiePercent(t.percent,g),f&&-1!==f.indexOf("percent")&&y.push(t.percentLabel);var b=u.hoverlabel,_=b.font;i.loneHover({trace:o,x0:p-d*a.r,x1:p+d*a.r,y:h,text:y.join("<br>"),name:u.hovertemplate||-1!==f.indexOf("name")?u.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:v.castOption(b.bgcolor,t.pts)||t.color,borderColor:v.castOption(b.bordercolor,t.pts),fontFamily:v.castOption(_.family,t.pts),fontSize:v.castOption(_.size,t.pts),fontColor:v.castOption(_.color,t.pts),nameLength:v.castOption(b.namelength,t.pts),textAlign:v.castOption(b.align,t.pts),hovertemplate:v.castOption(u.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[m(t,u)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e}),o._hasHoverLabel=!0}o._hasHoverEvent=!0,e.emit("plotly_hover",{points:[m(t,u)],event:n.event})}})),t.on("mouseout",(function(t){var r=e._fullLayout,a=e._fullData[o.index],l=n.select(this).datum();o._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[m(l,a)],event:n.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),o._hasHoverLabel=!1)})),t.on("click",(function(t){var r=e._fullLayout,a=e._fullData[o.index];e._dragging||!1===r.hovermode||(e._hoverdata=[m(t,a)],i.click(e,n.event))}))}function b(t,e,r){var n=v.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=v.castOption(t._input.textfont.color,e.pts));var a=v.castOption(t.insidetextfont.family,e.pts)||v.castOption(t.textfont.family,e.pts)||r.family,i=v.castOption(t.insidetextfont.size,e.pts)||v.castOption(t.textfont.size,e.pts)||r.size;return{color:n||o.contrast(e.color),family:a,size:i}}function _(t,e){for(var r,n,a=0;a<t.length;a++)if((n=(r=t[a][0]).trace).title.text){var i=n.title.text;n._meta&&(i=s.templateString(i,n._meta));var o=l.tester.append("text").attr("data-notex",1).text(i).call(l.font,n.title.font).call(f.convertToTspans,e),c=l.bBox(o.node(),!0);r.titleBox={width:c.width,height:c.height},o.remove()}}function w(t,e,r){var n=r.r||e.rpx1,a=e.rInscribed;if(e.startangle===e.stopangle)return{rCenter:1-a,scale:0,rotate:0,textPosAngle:0};var i,o=e.ring,l=1===o&&Math.abs(e.startangle-e.stopangle)===2*Math.PI,s=e.halfangle,c=e.midangle,u=r.trace.insidetextorientation,f="horizontal"===u,d="tangential"===u,p="radial"===u,h="auto"===u,g=[];if(!h){var v,m=function(r,a){if(function(t,e){var r=t.startangle,n=t.stopangle;return r>e&&e>n||r<e&&e<n}(e,r)){var l=Math.abs(r-e.startangle),s=Math.abs(r-e.stopangle),c=l<s?l:s;(i="tan"===a?k(t,n,o,c,0):T(t,n,o,c,Math.PI/2)).textPosAngle=r,g.push(i)}};if(f||d){for(v=4;v>=-4;v-=2)m(Math.PI*v,"tan");for(v=4;v>=-4;v-=2)m(Math.PI*(v+1),"tan")}if(f||p){for(v=4;v>=-4;v-=2)m(Math.PI*(v+1.5),"rad");for(v=4;v>=-4;v-=2)m(Math.PI*(v+.5),"rad")}}if(l||h||f){var y=Math.sqrt(t.width*t.width+t.height*t.height);if((i={scale:a*n*2/y,rCenter:1-a,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,i.scale>=1)return i;g.push(i)}(h||p)&&((i=T(t,n,o,s,c)).textPosAngle=(e.startangle+e.stopangle)/2,g.push(i)),(h||d)&&((i=k(t,n,o,s,c)).textPosAngle=(e.startangle+e.stopangle)/2,g.push(i));for(var x=0,b=0,_=0;_<g.length;_++){var w=g[_].scale;if(b<w&&(b=w,x=_),!h&&b>=1)break}return g[x]}function T(t,e,r,n,a){e=Math.max(0,e-2*g);var i=t.width/t.height,o=L(i,n,e,r);return{scale:2*o/t.height,rCenter:M(i,o/e),rotate:A(a)}}function k(t,e,r,n,a){e=Math.max(0,e-2*g);var i=t.height/t.width,o=L(i,n,e,r);return{scale:2*o/t.width,rCenter:M(i,o/e),rotate:A(a+Math.PI/2)}}function M(t,e){return Math.cos(e)-t*e}function A(t){return(180/Math.PI*t+720)%180-90}function L(t,e,r,n){var a=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(t*t+n/2)+t))}function S(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function C(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,i=t.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function O(t,e){var r,n,a,i=t.trace,o={x:t.cx,y:t.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=z(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*t.r,l.ty-=t.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*t.r);var s,c,u=(s=t.r,c=t.trace.aspectratio,s/(void 0===c?1:c)),f=e.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(f+=u,o.x-=(1+a)*u,l.tx+=t.titleBox.width/2):-1!==i.title.position.indexOf("center")?f*=2:-1!==i.title.position.indexOf("right")&&(f+=u,o.x+=(1+a)*u,l.tx-=t.titleBox.width/2),r=f/t.titleBox.width,n=D(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function D(t,e){var r=t.trace,n=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,n/2)}function z(t){var e,r=t.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,e=0;e<t.pull.length;e++)t.pull[e]>r&&(r=t.pull[e]);return r}function P(t,e){for(var r=[],n=0;n<t.length;n++){var a=t[n][0],i=a.trace,o=i.domain,l=e.w*(o.x[1]-o.x[0]),s=e.h*(o.y[1]-o.y[0]);i.title.text&&"middle center"!==i.title.position&&(s-=D(a,e));var c=l/2,u=s/2;"funnelarea"!==i.type||i.scalegroup||(u/=i.aspectratio),a.r=Math.min(c,u)/(1+z(i)),a.cx=e.l+e.w*(i.domain.x[1]+i.domain.x[0])/2,a.cy=e.t+e.h*(1-i.domain.y[0])-s/2,i.title.text&&-1!==i.title.position.indexOf("bottom")&&(a.cy-=D(a,e)),i.scalegroup&&-1===r.indexOf(i.scalegroup)&&r.push(i.scalegroup)}!function(t,e){for(var r,n,a,i=0;i<e.length;i++){var o=1/0,l=e[i];for(n=0;n<t.length;n++)if(r=t[n][0],(a=r.trace).scalegroup===l){var s;if("pie"===a.type)s=r.r*r.r;else if("funnelarea"===a.type){var c,u;a.aspectratio>1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,s=c*u}o=Math.min(o,s/r.vTotal)}for(n=0;n<t.length;n++)if(r=t[n][0],(a=r.trace).scalegroup===l){var f=o*r.vTotal;"funnelarea"===a.type&&(f/=(1+a.baseratio)/2,f/=a.aspectratio),r.r=Math.sqrt(f)}}}(t,r)}function E(t,e){return[t*Math.sin(e),-t*Math.cos(e)]}function I(t,e,r){var n=t._fullLayout,a=r.trace,i=a.texttemplate,o=a.textinfo;if(!i&&o&&"none"!==o){var l,c=o.split("+"),u=function(t){return-1!==c.indexOf(t)},f=u("label"),d=u("text"),p=u("value"),h=u("percent"),g=n.separators;if(l=f?[e.label]:[],d){var m=v.getFirstFilled(a.text,e.pts);y(m)&&l.push(m)}p&&l.push(v.formatPieValue(e.v,g)),h&&l.push(v.formatPiePercent(e.v/r.vTotal,g)),e.text=l.join("<br>")}if(i){var x=s.castOption(a,e.i,"texttemplate");if(x){var b=function(t){return{label:t.label,value:t.v,valueLabel:v.formatPieValue(t.v,n.separators),percent:t.v/r.vTotal,percentLabel:v.formatPiePercent(t.v/r.vTotal,n.separators),color:t.color,text:t.text,customdata:s.castOption(a,t.i,"customdata")}}(e),_=v.getFirstFilled(a.text,e.pts);(y(_)||""===_)&&(b.text=_),e.text=s.texttemplateString(x,b,t._fullLayout._d3locale,b,a._meta||{})}else e.text=""}}function R(t,e){var r=t.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=i*n-o*a,t.textY=i*a+o*n,t.noCenter=!0}e.exports={plot:function(t,e){var r=t._fullLayout,i=r._size;h("pie",r),_(e,t),P(e,i);var d=s.makeTraceGroups(r._pielayer,e,"trace").each((function(e){var d=n.select(this),h=e[0],g=h.trace;!function(t){var e,r,n,a=t[0],i=a.r,o=a.trace,l=v.getRotationAngle(o.rotation),s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(e=0;e<t.length&&t[e].hidden;e++);if(e===t.length)return;l+=s*t[e].v,s*=-1,c="px1",u="px0"}for(n=E(i,l),e=0;e<t.length;e++)(r=t[e]).hidden||(r[c]=n,r.startangle=l,l+=s*r.v/2,r.pxmid=E(i,l),r.midangle=l,l+=s*r.v/2,n=E(i,l),r.stopangle=l,r[u]=n,r.largeArc=r.v>a.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=S(r,a))}(e),d.attr("stroke-linejoin","round"),d.each((function(){var m=n.select(this).selectAll("g.slice").data(e);m.enter().append("g").classed("slice",!0),m.exit().remove();var y=[[[],[]],[[],[]]],_=!1;m.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=g.index,y[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=h.cx,c=h.cy,u=n.select(this),d=u.selectAll("path.surface").data([a]);if(d.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),u.call(x,t,e),g.pull){var m=+v.castOption(g.pull,a.pts)||0;m>0&&(o+=m*a.pxmid[0],c+=m*a.pxmid[1])}a.cxFinal=o,a.cyFinal=c;var T=g.hole;if(a.v===h.vTotal){var k="M"+(o+a.px0[0])+","+(c+a.px0[1])+O(a.px0,a.pxmid,!0,1)+O(a.pxmid,a.px0,!0,1)+"Z";T?d.attr("d","M"+(o+T*a.px0[0])+","+(c+T*a.px0[1])+O(a.px0,a.pxmid,!1,T)+O(a.pxmid,a.px0,!1,T)+"Z"+k):d.attr("d",k)}else{var M=O(a.px0,a.px1,!0,1);if(T){var A=1-T;d.attr("d","M"+(o+T*a.px1[0])+","+(c+T*a.px1[1])+O(a.px1,a.px0,!1,T)+"l"+A*a.px0[0]+","+A*a.px0[1]+M+"Z")}else d.attr("d","M"+o+","+c+"l"+a.px0[0]+","+a.px0[1]+M+"Z")}I(t,a,h);var L=v.castOption(g.textposition,a.pts),S=u.selectAll("g.slicetext").data(a.text&&"none"!==L?[0]:[]);S.enter().append("g").classed("slicetext",!0),S.exit().remove(),S.each((function(){var u=s.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),d=s.ensureUniformFontSize(t,"outside"===L?function(t,e,r){var n=v.castOption(t.outsidetextfont.color,e.pts)||v.castOption(t.textfont.color,e.pts)||r.color,a=v.castOption(t.outsidetextfont.family,e.pts)||v.castOption(t.textfont.family,e.pts)||r.family,i=v.castOption(t.outsidetextfont.size,e.pts)||v.castOption(t.textfont.size,e.pts)||r.size;return{color:n,family:a,size:i}}(g,a,r.font):b(g,a,r.font));u.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,d).call(f.convertToTspans,t);var m,y=l.bBox(u.node());if("outside"===L)m=C(y,a);else if(m=w(y,a,h),"auto"===L&&m.scale<1){var x=s.ensureUniformFontSize(t,g.outsidetextfont);u.call(l.font,x),m=C(y=l.bBox(u.node()),a)}var T=m.textPosAngle,k=void 0===T?a.pxmid:E(h.r,T);if(m.targetX=o+k[0]*m.rCenter+(m.x||0),m.targetY=c+k[1]*m.rCenter+(m.y||0),R(m,y),m.outside){var M=m.targetY;a.yLabelMin=M-y.height/2,a.yLabelMid=M,a.yLabelMax=M+y.height/2,a.labelExtraX=0,a.labelExtraY=0,_=!0}m.fontSize=d.size,p(g.type,m,r),e[i].transform=m,u.attr("transform",s.getTextTransform(m))}))}function O(t,e,r,n){var i=n*(e[0]-t[0]),o=n*(e[1]-t[1]);return"a"+n*h.r+","+n*h.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var T=n.select(this).selectAll("g.titletext").data(g.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var e,r=s.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),a=g.title.text;g._meta&&(a=s.templateString(a,g._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,g.title.font).call(f.convertToTspans,t),e="middle center"===g.title.position?function(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}(h):O(h,i),r.attr("transform",u(e.x,e.y)+c(Math.min(1,e.scale))+u(e.tx,e.ty))})),_&&function(t,e){var r,n,a,i,o,l,s,c,u,f,d,p,h;function g(t,e){return t.pxmid[1]-e.pxmid[1]}function m(t,e){return e.pxmid[1]-t.pxmid[1]}function y(t,r){r||(r={});var a,c,u,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),h=n?t.yLabelMin:t.yLabelMax,g=n?t.yLabelMax:t.yLabelMin,m=t.cyFinal+o(t.px0[1],t.px1[1]),y=p-h;if(y*s>0&&(t.labelExtraY=y),Array.isArray(e.pull))for(c=0;c<f.length;c++)(u=f[c])===t||(v.castOption(e.pull,t.pts)||0)>=(v.castOption(e.pull,u.pts)||0)||((t.pxmid[1]-u.pxmid[1])*s>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-h-t.labelExtraY)*s>0&&(t.labelExtraY+=y):(g+t.labelExtraY-m)*s>0&&(a=3*l*Math.abs(c-f.indexOf(t)),(d=u.cxFinal+i(u.px0[0],u.px1[0])+a-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*l>0&&(t.labelExtraX+=d)))}for(n=0;n<2;n++)for(a=n?g:m,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=t[n][r]).sort(a),u=t[1-n][r],f=u.concat(c),p=[],d=0;d<c.length;d++)void 0!==c[d].yLabelMid&&p.push(c[d]);for(h=!1,d=0;n&&d<u.length;d++)if(void 0!==u[d].yLabelMid){h=u[d];break}for(d=0;d<p.length;d++){var x=d&&p[d-1];h&&!d&&(x=h),y(p[d],x)}}}(y,g),function(t,e){t.each((function(t){var r=n.select(this);if(t.labelExtraX||t.labelExtraY){var a=r.select("g.slicetext text");t.transform.targetX+=t.labelExtraX,t.transform.targetY+=t.labelExtraY,a.attr("transform",s.getTextTransform(t.transform));var i=t.cxFinal+t.pxmid[0],l="M"+i+","+(t.cyFinal+t.pxmid[1]),c=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var u=t.labelExtraX*t.pxmid[1]/t.pxmid[0],f=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(u)>Math.abs(f)?l+="l"+f*t.pxmid[0]/t.pxmid[1]+","+f+"H"+(i+t.labelExtraX+c):l+="l"+t.labelExtraX+","+u+"v"+(f-u)+"h"+c}else l+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(m,g),_&&g.automargin){var k=l.bBox(d.node()),M=g.domain,A=i.w*(M.x[1]-M.x[0]),L=i.h*(M.y[1]-M.y[0]),S=(.5*A-h.r)/i.w,D=(.5*L-h.r)/i.h;a.autoMargin(t,"pie."+g.uid+".automargin",{xl:M.x[0]-S,xr:M.x[1]+S,yb:M.y[0]-D,yt:M.y[1]+D,l:Math.max(h.cx-h.r-k.left,0),r:Math.max(k.right-(h.cx+h.r),0),b:Math.max(k.bottom-(h.cy+h.r),0),t:Math.max(h.cy-h.r-k.top,0),pad:5})}}))}));setTimeout((function(){d.selectAll("tspan").each((function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))}))}),0)},formatSliceLabel:I,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:O,prerenderTitles:_,layoutAreas:P,attachFxHandlers:x,computeTransform:R}},{"../../components/color":105,"../../components/drawing":127,"../../components/fx":145,"../../lib":233,"../../lib/svg_text_utils":255,"../../plots/plots":313,"../bar/constants":338,"../bar/uniform_text":352,"./event_data":438,"./helpers":439,d3:21}],444:[function(t,e,r){"use strict";var n=t("d3"),a=t("./style_one"),i=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._pielayer.selectAll(".trace");i(t,e,"pie"),e.each((function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each((function(t){n.select(this).call(a,t,e)}))}))}},{"../bar/uniform_text":352,"./style_one":445,d3:21}],445:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("./helpers").castOption;e.exports=function(t,e,r){var i=r.marker.line,o=a(i.color,e.pts)||n.defaultLine,l=a(i.width,e.pts)||0;t.style("stroke-width",l).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":105,"./helpers":439}],446:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;n.mergeArray(e.text,t,"tx"),n.mergeArray(e.texttemplate,t,"txt"),n.mergeArray(e.hovertext,t,"htx"),n.mergeArray(e.customdata,t,"data"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArrayCastPositive(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf"));var a=e.marker;if(a){n.mergeArrayCastPositive(a.size,t,"ms"),n.mergeArrayCastPositive(a.opacity,t,"mo"),n.mergeArray(a.symbol,t,"mx"),n.mergeArray(a.color,t,"mc");var i=a.line;a.line&&(n.mergeArray(i.color,t,"mlc"),n.mergeArrayCastPositive(i.width,t,"mlw"));var o=a.gradient;o&&"none"!==o.type&&(n.mergeArray(o.type,t,"mgt"),n.mergeArray(o.color,t,"mgc"))}}},{"../../lib":233}],447:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").texttemplateAttrs,a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../components/colorscale/attributes"),o=t("../../plots/font_attributes"),l=t("../../components/drawing/attributes").dash,s=t("../../components/drawing"),c=t("./constants"),u=t("../../lib/extend").extendFlat;e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:{valType:"any",dflt:0,editType:"calc"},yperiod:{valType:"any",dflt:0,editType:"calc"},xperiod0:{valType:"any",editType:"calc"},yperiod0:{valType:"any",editType:"calc"},xperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},yperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},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":112,"../../components/drawing":127,"../../components/drawing/attributes":126,"../../lib/extend":227,"../../plots/font_attributes":307,"../../plots/template_attributes":321,"./constants":451}],448:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/align_period"),l=t("../../constants/numerical").BADNUM,s=t("./subtypes"),c=t("./colorscale_calc"),u=t("./arrays_to_calcdata"),f=t("./calc_selection");function d(t,e,r,n,a,o,l){var c=e._length,u=t._fullLayout,f=r._id,d=n._id,p=u._firstScatter[g(e)]===e.uid,h=(v(e,u,r,n)||{}).orientation,m=e.fill;r._minDtick=0,n._minDtick=0;var y={padded:!0},x={padded:!0};l&&(y.ppad=x.ppad=l);var b=c<2||a[0]!==a[c-1]||o[0]!==o[c-1];b&&("tozerox"===m||"tonextx"===m&&(p||"h"===h))?y.tozero=!0:(e.error_y||{}).visible||"tonexty"!==m&&"tozeroy"!==m&&(s.hasMarkers(e)||s.hasText(e))||(y.padded=!1,y.ppad=0),b&&("tozeroy"===m||"tonexty"===m&&(p||"v"===h))?x.tozero=!0:"tonextx"!==m&&"tozerox"!==m||(x.padded=!1),f&&(e._extremes[f]=i.findExtremes(r,a,y)),d&&(e._extremes[d]=i.findExtremes(n,o,x))}function p(t,e){if(s.hasMarkers(t)){var r,n=t.marker,o=1.6*(t.marker.sizeref||1);if(r="area"===t.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/o),3)}:function(t){return Math.max((t||0)/o,3)},a.isArrayOrTypedArray(n.size)){var l={type:"linear"};i.setConvert(l);for(var c=l.makeCalcdata(t.marker,"size"),u=new Array(e),f=0;f<e;f++)u[f]=r(c[f]);return u}return r(n.size)}}function h(t,e){var r=g(e),n=t._firstScatter;n[r]||(n[r]=e.uid)}function g(t){var e=t.stackgroup;return t.xaxis+t.yaxis+t.type+(e?"-"+e:"")}function v(t,e,r,n){var a=t.stackgroup;if(a){var i=e._scatterStackOpts[r._id+n._id][a],o="v"===i.orientation?n:r;return"linear"===o.type||"log"===o.type?i:void 0}}e.exports={calc:function(t,e){var r,s,g,m,y,x,b=t._fullLayout,_=i.getFromId(t,e.xaxis||"x"),w=i.getFromId(t,e.yaxis||"y"),T=_.makeCalcdata(e,"x"),k=w.makeCalcdata(e,"y"),M=o(e,_,"x",T),A=o(e,w,"y",k),L=e._length,S=new Array(L),C=e.ids,O=v(e,b,_,w),D=!1;h(b,e);var z,P="x",E="y";O?(a.pushUnique(O.traceIndices,e._expandedIndex),(r="v"===O.orientation)?(E="s",z="x"):(P="s",z="y"),y="interpolate"===O.stackgaps):d(t,e,_,w,M,A,p(e,L));var I=!!e.xperiodalignment,R=!!e.yperiodalignment;for(s=0;s<L;s++){var F=S[s]={},N=n(M[s]),B=n(A[s]);N&&B?(F[P]=M[s],F[E]=A[s],I&&(F.orig_x=T[s]),R&&(F.orig_y=k[s])):O&&(r?N:B)?(F[z]=r?M[s]:A[s],F.gap=!0,y?(F.s=l,D=!0):F.s=0):F[P]=F[E]=l,C&&(F.id=String(C[s]))}if(u(S,e),c(t,e),f(S,e),O){for(s=0;s<S.length;)S[s][z]===l?S.splice(s,1):s++;if(a.sort(S,(function(t,e){return t[z]-e[z]||t.i-e.i})),D){for(s=0;s<S.length-1&&S[s].gap;)s++;for((x=S[s].s)||(x=S[s].s=0),g=0;g<s;g++)S[g].s=x;for(m=S.length-1;m>s&&S[m].gap;)m--;for(x=S[m].s,g=S.length-1;g>m;g--)S[g].s=x;for(;s<m;)if(S[++s].gap){for(g=s+1;S[g].gap;)g++;for(var H=S[s-1][z],j=S[s-1].s,U=(S[g].s-j)/(S[g][z]-H);s<g;)S[s].s=j+(S[s][z]-H)*U,s++}}}return S},calcMarkerSize:p,calcAxisExpansion:d,setFirstScatter:h,getStackOpts:v}},{"../../constants/numerical":212,"../../lib":233,"../../plots/cartesian/align_period":276,"../../plots/cartesian/axes":279,"./arrays_to_calcdata":446,"./calc_selection":449,"./colorscale_calc":450,"./subtypes":472,"fast-isnumeric":23}],449:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){n.isArrayOrTypedArray(e.selectedpoints)&&n.tagSelected(t,e)}},{"../../lib":233}],450:[function(t,e,r){"use strict";var n=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/calc"),i=t("./subtypes");e.exports=function(t,e){i.hasLines(e)&&n(e,"line")&&a(t,e,{vals:e.line.color,containerStr:"line",cLetter:"c"}),i.hasMarkers(e)&&(n(e,"marker")&&a(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),n(e,"marker.line")&&a(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}},{"../../components/colorscale/calc":113,"../../components/colorscale/helpers":116,"./subtypes":472}],451:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}},{}],452:[function(t,e,r){"use strict";var n=t("./calc");function a(t,e,r,n,a,i,o){a[n]=!0;var l={i:null,gap:!0,s:0};if(l[o]=r,t.splice(e,0,l),e&&r===t[e-1][o]){var s=t[e-1];l.s=s.s,l.i=s.i,l.gap=s.gap}else i&&(l.s=function(t,e,r,n){var a=t[e-1],i=t[e+1];return i?a?a.s+(i.s-a.s)*(r-a[n])/(i[n]-a[n]):i.s:a.s}(t,e,r,o));e||(t[0].t=t[1].t,t[0].trace=t[1].trace,delete t[1].t,delete t[1].trace)}e.exports=function(t,e){var r=e.xaxis,i=e.yaxis,o=r._id+i._id,l=t._fullLayout._scatterStackOpts[o];if(l){var s,c,u,f,d,p,h,g,v,m,y,x,b,_,w,T=t.calcdata;for(var k in l){var M=(m=l[k]).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=T[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=T[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(T[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=T[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=T[M[s]][c];S[_]/=v,S.sNorm=S.s/v}}for(s=0;s<M.length;s++){var C=(d=T[M[s]])[0].trace,O=n.calcMarkerSize(C,C._rawLength),D=Array.isArray(O);if(O&&w[s]||D){var z=O;for(O=new Array(L),c=0;c<L;c++)O[c]=d[c].gap?0:D?z[d[c].i]:z}var P=new Array(L),E=new Array(L);for(c=0;c<L;c++)P[c]=d[c].x,E[c]=d[c].y;n.calcAxisExpansion(t,C,r,i,P,E,O),d[0].t.orientation=m.orientation}}}}}},{"./calc":448}],453:[function(t,e,r){"use strict";e.exports=function(t){for(var e=0;e<t.length;e++){var r=t[e];if("scatter"===r.type){var n=r.fill;if("none"!==n&&"toself"!==n&&(r.opacity=void 0,"tonexty"===n||"tonextx"===n))for(var a=e-1;a>=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],454:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),l=t("./subtypes"),s=t("./xy_defaults"),c=t("./period_defaults"),u=t("./stack_defaults"),f=t("./marker_defaults"),d=t("./line_defaults"),p=t("./line_shape_defaults"),h=t("./text_defaults"),g=t("./fillcolor_defaults");e.exports=function(t,e,r,v){function m(r,a){return n.coerce(t,e,i,r,a)}var y=s(t,e,v,m);if(y||(e.visible=!1),e.visible){c(t,e,v,m);var x=u(t,e,v,m),b=!x&&y<o.PTS_LINESONLY?"lines+markers":"lines";m("text"),m("hovertext"),m("mode",b),l.hasLines(e)&&(d(t,e,r,v,m),p(t,e,m),m("connectgaps"),m("line.simplify")),l.hasMarkers(e)&&f(t,e,r,v,m,{gradient:!0}),l.hasText(e)&&(m("texttemplate"),h(t,e,v,m));var _=[];(l.hasMarkers(e)||l.hasText(e))&&(m("cliponaxis"),m("marker.maxdisplayed"),_.push("points")),m("fill",x?x.fillDflt:"none"),"none"!==e.fill&&(g(t,e,r,m),l.hasLines(e)||p(t,e,m));var w=(e.line||{}).color,T=(e.marker||{}).color;"tonext"!==e.fill&&"toself"!==e.fill||_.push("fills"),m("hoveron",_.join("+")||"points"),"fills"!==e.hoveron&&m("hovertemplate");var k=a.getComponentMethod("errorbars","supplyDefaults");k(t,e,w||T||r,{axis:"y"}),k(t,e,w||T||r,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,m)}}},{"../../lib":233,"../../registry":326,"./attributes":447,"./constants":451,"./fillcolor_defaults":455,"./line_defaults":460,"./line_shape_defaults":462,"./marker_defaults":466,"./period_defaults":467,"./stack_defaults":470,"./subtypes":472,"./text_defaults":473,"./xy_defaults":474}],455:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i){var o=!1;if(e.marker){var l=e.marker.color,s=(e.marker.line||{}).color;l&&!a(l)?o=l:s&&!a(s)&&(o=s)}i("fillcolor",n.addOpacity((e.line||{}).color||o||r,.5))}},{"../../components/color":105,"../../lib":233}],456:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes");e.exports=function(t,e,r){var a={},i={_fullLayout:r},o=n.getFromTrace(i,e,"x"),l=n.getFromTrace(i,e,"y");return a.xLabel=n.tickText(o,t.x,!0).text,a.yLabel=n.tickText(l,t.y,!0).text,a}},{"../../plots/cartesian/axes":279}],457:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("./subtypes");e.exports=function(t,e){var r,i;if("lines"===t.mode)return(r=t.line.color)&&n.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var o=e.mcc||(t.marker||{}).color,l=e.mlcc||((t.marker||{}).line||{}).color;return(i=o&&n.opacity(o)?o:l&&n.opacity(l)&&(e.mlw||((t.marker||{}).line||{}).width)?l:"")?n.opacity(i)<.3?n.addOpacity(i,.3):i:(r=(t.line||{}).color)&&n.opacity(r)&&a.hasLines(t)&&t.line.width?r:t.fillcolor}},{"../../components/color":105,"./subtypes":472}],458:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/fx"),i=t("../../registry"),o=t("./get_trace_color"),l=t("../../components/color"),s=n.fillText;e.exports=function(t,e,r,c){var u=t.cd,f=u[0].trace,d=t.xa,p=t.ya,h=d.c2p(e),g=p.c2p(r),v=[h,g],m=f.hoveron||"",y=-1!==f.mode.indexOf("markers")?3:.5;if(-1!==m.indexOf("points")){var x=function(t){var e=Math.max(y,t.mrc||0),r=d.c2p(t.x)-h,n=p.c2p(t.y)-g;return Math.max(Math.sqrt(r*r+n*n)-e,1-y/e)},b=a.getDistanceFunction(c,(function(t){var e=Math.max(3,t.mrc||0),r=1-1/e,n=Math.abs(d.c2p(t.x)-h);return n<e?r*n/e:n-e+r}),(function(t){var e=Math.max(3,t.mrc||0),r=1-1/e,n=Math.abs(p.c2p(t.y)-g);return n<e?r*n/e:n-e+r}),x);if(a.getClosest(u,b,t),!1!==t.index){var _=u[t.index],w=d.c2p(_.x,!0),T=p.c2p(_.y,!0),k=_.mrc||1;t.index=_.i;var M=u[0].t.orientation,A=M&&(_.sNorm||_.s),L="h"===M?A:void 0!==_.orig_x?_.orig_x:_.x,S="v"===M?A:void 0!==_.orig_y?_.orig_y:_.y;return n.extendFlat(t,{color:o(f,_),x0:w-k,x1:w+k,xLabelVal:L,y0:T-k,y1:T+k,yLabelVal:S,spikeDistance:x(_),hovertemplate:f.hovertemplate}),s(_,f,t),i.getComponentMethod("errorbars","hoverInfo")(_,f,t),[t]}}if(-1!==m.indexOf("fills")&&f._polygons){var C,O,D,z,P,E,I,R,F,N=f._polygons,B=[],H=!1,j=1/0,U=-1/0,V=1/0,q=-1/0;for(C=0;C<N.length;C++)(D=N[C]).contains(v)&&(H=!H,B.push(D),V=Math.min(V,D.ymin),q=Math.max(q,D.ymax));if(H){var G=((V=Math.max(V,0))+(q=Math.min(q,p._length)))/2;for(C=0;C<B.length;C++)for(z=B[C].pts,O=1;O<z.length;O++)(R=z[O-1][1])>G!=(F=z[O][1])>=G&&(E=z[O-1][0],I=z[O][0],F-R&&(P=E+(I-E)*(G-R)/(F-R),j=Math.min(j,P),U=Math.max(U,P)));j=Math.max(j,0),U=Math.min(U,d._length);var Z=l.defaultLine;return l.opacity(f.fillcolor)?Z=f.fillcolor:l.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:j,x1:U,y0:G,y1:G,color:Z,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":105,"../../components/fx":145,"../../lib":233,"../../registry":326,"./get_trace_color":457}],459:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":292,"./arrays_to_calcdata":446,"./attributes":447,"./calc":448,"./cross_trace_calc":452,"./cross_trace_defaults":453,"./defaults":454,"./format_labels":456,"./hover":458,"./marker_colorbar":465,"./plot":468,"./select":469,"./style":471,"./subtypes":472}],460:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,l,s){var c=(t.marker||{}).color;(l("line.color",r),a(t,"line"))?i(t,e,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":115,"../../components/colorscale/helpers":116,"../../lib":233}],461:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=t("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=t("./constants");e.exports=function(t,e){var r,n,i,d,p,h,g,v,m,y,x,b,_,w,T,k,M,A,L=e.xaxis,S=e.yaxis,C="log"===L.type,O="log"===S.type,D=L._length,z=S._length,P=e.connectGaps,E=e.baseTolerance,I=e.shape,R="linear"===I,F=e.fill&&"none"!==e.fill,N=[],B=f.minTolerance,H=t.length,j=new Array(H),U=0;function V(r){var n=t[r];if(!n)return!1;var i=e.linearized?L.l2p(n.x):L.c2p(n.x),s=e.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(C&&(i=L.c2p(n.x,!0)),i===a)return!1;O&&s===a&&(i*=Math.abs(L._m*z*(L._m>0?o:l)/(S._m*D*(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 q(t,e,r,n){var a=r-t,i=n-e,o=.5-t,l=.5-e,s=a*a+i*i,c=a*o+i*l;if(c>0&&c<s){var u=o*i-l*a;if(u*u<s)return!0}}function G(t,e){var r=t[0]/D,n=t[1]/z,a=Math.max(0,-r,r-1,-n,n-1);return a&&void 0!==M&&q(r,n,M,A)&&(a=0),a&&e&&q(r,n,e[0]/D,e[1]/z)&&(a=0),(1+f.toleranceGrowth*a)*E}function Z(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var Y,X,W,Q,J,$,K,tt=f.maxScreensAway,et=-D*tt,rt=D*(1+tt),nt=-z*tt,at=z*(1+tt),it=[[et,nt,rt,nt],[rt,nt,rt,at],[rt,at,et,at],[et,at,et,nt]];function ot(t){if(t[0]<et||t[0]>rt||t[1]<nt||t[1]>at)return[u(t[0],et,rt),u(t[1],nt,at)]}function lt(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===at)||void 0)}function st(t,e,r){return function(n,a){var i=ot(n),o=ot(a),l=[];if(i&&o&&lt(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);c&&((i&&o?c>0==i[t]>o[t]?i:o:i||o)[t]+=c);return l}}function ct(t){var e=t[0],r=t[1],n=e===j[U-1][0],a=r===j[U-1][1];if(!n||!a)if(U>1){var i=e===j[U-2][0],o=r===j[U-2][1];n&&(e===et||e===rt)&&i?o?U--:j[U-1]=t:a&&(r===nt||r===at)&&o?i?U--:j[U-1]=t:j[U++]=t}else j[U++]=t}function ut(t){j[U-1][0]!==t[0]&&j[U-1][1]!==t[1]&&ct([W,Q]),ct(t),J=null,W=Q=0}function ft(t){if(M=t[0]/D,A=t[1]/z,Y=t[0]<et?et:t[0]>rt?rt:0,X=t[1]<nt?nt:t[1]>at?at:0,Y||X){if(U)if(J){var e=K(J,t);e.length>1&&(ut(e[0]),j[U++]=e[1])}else $=K(j[U-1],t)[0],j[U++]=$;else j[U++]=[Y||t[0],X||t[1]];var r=j[U-1];Y&&X&&(r[0]!==Y||r[1]!==X)?(J&&(W!==Y&&Q!==X?ct(W&&Q?(n=J,i=(a=t)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?et:rt,at]:[o>0?rt:et,nt]):[W||Y,Q||X]):W&&Q&&ct([W,Q])),ct([Y,X])):W-Y&&Q-X&&ct([Y||W,X||Q]),J=t,W=Y,Q=X}else J&&ut(K(J,t)[0]),j[U++]=t;var n,a,i,o}for("linear"===I||"spline"===I?K=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=it[a],o=c(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Z(o,t)<Z(r[0],t)?r.unshift(o):r.push(o),n++)}return r}:"hv"===I||"vh"===I?K=function(t,e){var r=[],n=ot(t),a=ot(e);return n&&a&&lt(n,a)||(n&&r.push(n),a&&r.push(a)),r}:"hvh"===I?K=st(0,et,rt):"vhv"===I&&(K=st(1,nt,at)),r=0;r<H;r++)if(n=V(r)){for(U=0,J=null,ft(n),r++;r<H;r++){if(!(d=V(r))){if(P)continue;break}if(R&&e.simplify){var dt=V(r+1);if(y=Z(d,n),F&&(0===U||U===H-1)||!(y<G(d,dt)*B)){for(v=[(d[0]-n[0])/y,(d[1]-n[1])/y],p=n,x=y,b=w=T=0,g=!1,i=d,r++;r<t.length;r++){if(h=dt,dt=V(r+1),!h){if(P)continue;break}if(k=(m=[h[0]-n[0],h[1]-n[1]])[0]*v[1]-m[1]*v[0],w=Math.min(w,k),(T=Math.max(T,k))-w>G(h,dt))break;i=h,(_=m[0]*v[0]+m[1]*v[1])>x?(x=_,d=h,g=!1):_<b&&(b=_,p=h,g=!0)}if(g?(ft(d),i!==p&&ft(p)):(p!==n&&ft(p),i!==d&&ft(d)),ft(i),r>=t.length||!h)break;ft(h),n=h}}else ft(d)}J&&ct([W||J[0],Q||J[1]]),N.push(j.slice(0,U))}return N}},{"../../constants/numerical":212,"../../lib":233,"./constants":451}],462:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],463:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var a,i,o,l,s,c={},u=!1,f=-1,d=0,p=-1;for(i=0;i<r.length;i++)(o=(a=r[i][0].trace).stackgroup||"")?o in c?s=c[o]:(s=c[o]=d,d++):a.fill in n&&p>=0?s=p:(s=p=d,d++),s<f&&(u=!0),a._groupIndex=f=s;var h=r.slice();u&&h.sort((function(t,e){var r=t[0].trace,n=e[0].trace;return r._groupIndex-n._groupIndex||r.index-n.index}));var g={};for(i=0;i<h.length;i++)o=(a=h[i][0].trace).stackgroup||"",!0===a.visible?(a._nexttrace=null,a.fill in n&&(l=g[o],a._prevtrace=l||null,l&&(l._nexttrace=a)),a._ownfill=a.fill&&("tozero"===a.fill.substr(0,6)||"toself"===a.fill||"to"===a.fill.substr(0,2)&&!a._prevtrace),g[o]=a):a._prevtrace=a._nexttrace=a._ownfill=null;return h}},{}],464:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,a=e.sizemin||0,i="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=i(t/2);return n(e)&&e>0?Math.max(e,a):0}}},{"fast-isnumeric":23}],465:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],466:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,l,s,c){var u=o.isBubble(t),f=(t.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(t,"marker")&&i(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),a(t,"marker.line")&&i(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":105,"../../components/colorscale/defaults":115,"../../components/colorscale/helpers":116,"./subtypes":472}],467:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,a=t("../../constants/numerical").ONEWEEK;function i(t,e){return n(e,t%a==0?1:0)}e.exports=function(t,e,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,e.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":212,"../../lib":233}],468:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,l=i.identity,s=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),f=t("./link_traces"),d=t("../../lib/polygon").tester;function p(t,e,r,f,p,h,g){var v;!function(t,e,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]})),g=Math.ceil(h.length/p),v=0;o.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&v++}));var m=Math.round(v*g/3+Math.floor(v/3)*g/7.1);a.forEach((function(t){delete t.vis})),h.forEach((function(t,e){0===Math.round((e+m)%g)&&(t.vis=!0)}))}(0,e,r,f,p);var m=!!g&&g.duration>0;function y(t){return m?t.transition():t}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,T=n.select(h),k=o(T,"g","errorbars"),M=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(t,k,r,g),!0===_.visible){var S,C;y(T).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var D,z,P="",E=[],I=_._prevtrace;I&&(P=I._prevRevpath||"",C=I._nextFill,E=I._polygons);var R,F,N,B,H,j,U,V="",q="",G=[],Z=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=s.steps(w.shape),F=s.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),w.smoothing):s.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return F(t.reverse())},G=u(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),U=_._polygons=new Array(G.length),v=0;v<G.length;v++)_._polygons[v]=d(G[v]);G.length&&(B=G[0][0],j=(H=G[G.length-1])[H.length-1]),Z=function(t){return function(e){if(D=R(e),z=N(e),V?O?(V+="L"+D.substr(1),q=z+"L"+q.substr(1)):(V+="Z"+D,q=z+"Z"+q):(V=D,q=z),c.hasLines(_)&&e.length>1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",D).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",D),s.singleLineStyle(f,a)}}}}}var Y=M.selectAll(".js-line").data(G);y(Y.exit()).style("opacity",0).remove(),Y.each(Z(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),s.setClipUrl(Y,r.layerClipId,t),G.length?(S?(S.datum(f),B&&j&&(O?("y"===O?B[1]=j[1]=b.c2p(0,!0):"x"===O&&(B[0]=j[0]=x.c2p(0,!0)),y(S).attr("d","M"+j+"L"+B+"L"+V.substr(1)).call(s.singleFillStyle)):y(S).attr("d",V+"Z").call(s.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&V&&P?("tonext"===_.fill?y(C).attr("d",V+"Z"+P+"Z").call(s.singleFillStyle):y(C).attr("d",V+"L"+P.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(E)):(W(C),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=U):(S?W(S):C&&W(C),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(e,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=tt(u),h=et,g=et;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?J:Q:_&&!w&&(v=$),f&&(h=v),d&&(g=v)}var T,k=(o=e.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&k.call(s.pointStyle,u,t).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(T=s.makePointStyleFns(u)),o.each((function(e){var a=n.select(this),i=y(a);s.translatePoint(e,i,x,b)?(s.singlePointStyle(e,i,u,T,t),r.layerClipId&&s.hideOutsideRangePoint(e,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),a=y(e.select("text"));s.translatePoint(t,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(t,e,x,b,u.xcalendar,u.ycalendar):e.remove()})),o.selectAll("text").call(s.textPointStyle,u,t).each((function(t){var e=x.c2p(t.x),r=b.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(A,L,f);var X=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,X,t),s.setClipUrl(L,X,t)}function W(t){y(t).attr("d","M0,0Z")}function Q(t){return t.filter((function(t){return!t.gap&&t.vis}))}function J(t){return t.filter((function(t){return t.vis}))}function $(t){return t.filter((function(t){return!t.gap}))}function K(t){return t.id}function tt(t){if(t.ids)return K}function et(){return!1}}e.exports=function(t,e,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(t,e,r);((u=a.selectAll("g.trace").data(v,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(t,e,r){e.each((function(e){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(t){i[t]=null})).remove(),u.order().each((function(t){i[t]=o(n.select(this),"path","js-fill")}))}))}(t,u,e),g)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(t,n,e,r,v,this,i)}))}))):u.each((function(r,n){p(t,n,e,r,v,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":127,"../../lib":233,"../../lib/polygon":245,"../../registry":326,"./line_points":461,"./link_traces":463,"./subtypes":472,d3:21}],469:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,l=t.cd,s=t.xaxis,c=t.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r<l.length;r++)l[r].selected=0;else for(r=0;r<l.length;r++)a=l[r],i=s.c2p(a.x),o=c.c2p(a.y),null!==a.i&&e.contains([i,o],!1,r,t)?(u.push({pointNumber:a.i,x:s.c2d(a.x),y:c.c2d(a.y)}),a.selected=1):a.selected=0;return u}},{"./subtypes":472}],470:[function(t,e,r){"use strict";var n=["orientation","groupnorm","stackgaps"];e.exports=function(t,e,r,a){var i=r._scatterStackOpts,o=a("stackgroup");if(o){var l=e.xaxis+e.yaxis,s=i[l];s||(s=i[l]={});var c=s[o],u=!1;c?c.traces.push(e):(c=s[o]={traceIndices:[],traces:[e]},u=!0);for(var f={orientation:e.x&&!e.y?"h":"v"},d=0;d<n.length;d++){var p=n[d],h=p+"Found";if(!c[h]){var g=void 0!==t[p],v="orientation"===p;if((g||u)&&(c[p]=a(p,f[p]),v&&(c.fillDflt="h"===c[p]?"tonextx":"tonexty"),g&&(c[h]=!0,!u&&(delete c.traces[0][p],v))))for(var m=0;m<c.traces.length-1;m++){var y=c.traces[m];y._input.fill!==y.fill&&(y.fill=c.fillDflt)}}}return c}}},{}],471:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),i=t("../../registry");function o(t,e,r){a.pointStyle(t.selectAll("path.point"),e,r)}function l(t,e,r){a.textPointStyle(t.selectAll("text"),e,r)}e.exports={style:function(t){var e=n.select(t).selectAll("g.trace.scatter");e.style("opacity",(function(t){return t[0].trace.opacity})),e.selectAll("g.points").each((function(e){o(n.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.text").each((function(e){l(n.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.trace path.js-line").call(a.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(a.fillGroupStyle),i.getComponentMethod("errorbars","style")(e)},stylePoints:o,styleText:l,styleOnSelect:function(t,e,r){var n=e[0].trace;n.selectedpoints?(a.selectedPointStyle(r.selectAll("path.point"),n),a.selectedTextStyle(r.selectAll("text"),n)):(o(r,n,t),l(r,n,t))}}},{"../../components/drawing":127,"../../registry":326,d3:21}],472:[function(t,e,r){"use strict";var n=t("../../lib");e.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&(t.mode&&-1!==t.mode.indexOf("markers")||"splom"===t.type)},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){return n.isPlainObject(t.marker)&&n.isArrayOrTypedArray(t.marker.size)}}},{"../../lib":233}],473:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a,i){i=i||{},a("textposition"),n.coerceFont(a,"textfont",r.font),i.noSelect||(a("selected.textfont.color"),a("unselected.textfont.color"))}},{"../../lib":233}],474:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");e.exports=function(t,e,r,i){var o,l=i("x"),s=i("y");if(a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],r),l){var c=n.minRowLength(l);s?o=Math.min(c,n.minRowLength(s)):(o=c,i("y0"),i("dy"))}else{if(!s)return 0;o=n.minRowLength(s),i("x0"),i("dx")}return e._length=o,o}},{"../../lib":233,"../../registry":326}],475:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../plots/template_attributes").texttemplateAttrs,i=t("../scatter/attributes"),o=t("../../plots/attributes"),l=t("../../components/colorscale/attributes"),s=t("../../components/drawing/attributes").dash,c=t("../../lib/extend").extendFlat,u=i.marker,f=i.line,d=u.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:c({},i.mode,{dflt:"markers"}),text:c({},i.text,{}),texttemplate:a({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:c({},i.hovertext,{}),line:{color:f.color,width:f.width,dash:s,shape:c({},f.shape,{values:["linear","spline"]}),smoothing:f.smoothing,editType:"calc"},connectgaps:i.connectgaps,cliponaxis:i.cliponaxis,fill:c({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i.fillcolor,marker:c({symbol:u.symbol,opacity:u.opacity,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:c({width:d.width,editType:"calc"},l("marker.line")),gradient:u.gradient,editType:"calc"},l("marker")),textfont:i.textfont,textposition:i.textposition,selected:i.selected,unselected:i.unselected,hoverinfo:c({},o.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:i.hoveron,hovertemplate:n()}},{"../../components/colorscale/attributes":112,"../../components/drawing/attributes":126,"../../lib/extend":227,"../../plots/attributes":275,"../../plots/template_attributes":321,"../scatter/attributes":447}],476:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../scatter/colorscale_calc"),i=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),l=t("../scatter/calc").calcMarkerSize,s=["a","b","c"],c={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,u,f,d,p,h,g=t._fullLayout[e.subplot].sum,v=e.sum||g,m={a:e.a,b:e.b,c:e.c};for(r=0;r<s.length;r++)if(!m[f=s[r]]){for(p=m[c[f][0]],h=m[c[f][1]],d=new Array(p.length),u=0;u<p.length;u++)d[u]=v-p[u]-h[u];m[f]=d}var y,x,b,_,w,T,k=e._length,M=new Array(k);for(r=0;r<k;r++)y=m.a[r],x=m.b[r],b=m.c[r],n(y)&&n(x)&&n(b)?(1!==(_=g/((y=+y)+(x=+x)+(b=+b)))&&(y*=_,x*=_,b*=_),T=y,w=b-x,M[r]={x:w,y:T,a:y,b:x,c:b}):M[r]={x:!1,y:!1};return l(e,k),a(t,e),i(M,e),o(M,e),M}},{"../scatter/arrays_to_calcdata":446,"../scatter/calc":448,"../scatter/calc_selection":449,"../scatter/colorscale_calc":450,"fast-isnumeric":23}],477:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../scatter/constants"),i=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),l=t("../scatter/line_defaults"),s=t("../scatter/line_shape_defaults"),c=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),f=t("./attributes");e.exports=function(t,e,r,d){function p(r,a){return n.coerce(t,e,f,r,a)}var h,g=p("a"),v=p("b"),m=p("c");if(g?(h=g.length,v?(h=Math.min(h,v.length),m&&(h=Math.min(h,m.length))):h=m?Math.min(h,m.length):0):v&&m&&(h=Math.min(v.length,m.length)),h){e._length=h,p("sum"),p("text"),p("hovertext"),"fills"!==e.hoveron&&p("hovertemplate"),p("mode",h<a.PTS_LINESONLY?"lines+markers":"lines"),i.hasLines(e)&&(l(t,e,r,d,p),s(t,e,p),p("connectgaps")),i.hasMarkers(e)&&o(t,e,r,d,p,{gradient:!0}),i.hasText(e)&&(p("texttemplate"),c(t,e,d,p));var y=[];(i.hasMarkers(e)||i.hasText(e))&&(p("cliponaxis"),p("marker.maxdisplayed"),y.push("points")),p("fill"),"none"!==e.fill&&(u(t,e,r,p),i.hasLines(e)||s(t,e,p)),"tonext"!==e.fill&&"toself"!==e.fill||y.push("fills"),p("hoveron",y.join("+")||"points"),n.coerceSelectionMarkerOpacity(e,p)}else e.visible=!1}},{"../../lib":233,"../scatter/constants":451,"../scatter/fillcolor_defaults":455,"../scatter/line_defaults":460,"../scatter/line_shape_defaults":462,"../scatter/marker_defaults":466,"../scatter/subtypes":472,"../scatter/text_defaults":473,"./attributes":475}],478:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,a){if(e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),n[a]){var i=n[a];t.a=i.a,t.b=i.b,t.c=i.c}else t.a=e.a,t.b=e.b,t.c=e.c;return t}},{}],479:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes");e.exports=function(t,e,r){var a={},i=r[e.subplot]._subplot;return a.aLabel=n.tickText(i.aaxis,t.a,!0).text,a.bLabel=n.tickText(i.baxis,t.b,!0).text,a.cLabel=n.tickText(i.caxis,t.c,!0).text,a}},{"../../plots/cartesian/axes":279}],480:[function(t,e,r){"use strict";var n=t("../scatter/hover");e.exports=function(t,e,r,a){var i=n(t,e,r,a);if(i&&!1!==i[0].index){var o=i[0];if(void 0===o.index){var l=1-o.y0/t.ya._length,s=t.xa._length,c=s*l/2,u=s-c;return o.x0=Math.max(Math.min(o.x0,u),c),o.x1=Math.max(Math.min(o.x1,u),c),i}var f=o.cd[o.index],d=o.trace,p=o.subplot;o.a=f.a,o.b=f.b,o.c=f.c,o.xLabelVal=void 0,o.yLabelVal=void 0;var h={};h[d.subplot]={_subplot:p};var g=d._module.formatLabels(f,d,h);o.aLabel=g.aLabel,o.bLabel=g.bLabel,o.cLabel=g.cLabel;var v=f.hi||d.hoverinfo,m=[];if(!d.hovertemplate){var y=v.split("+");-1!==y.indexOf("all")&&(y=["a","b","c"]),-1!==y.indexOf("a")&&x(p.aaxis,o.aLabel),-1!==y.indexOf("b")&&x(p.baxis,o.bLabel),-1!==y.indexOf("c")&&x(p.caxis,o.cLabel)}return o.extraText=m.join("<br>"),o.hovertemplate=d.hovertemplate,i}function x(t,e){m.push(t._hovertitle+": "+e)}}},{"../scatter/hover":458}],481:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../scatter/select"),eventData:t("./event_data"),moduleType:"trace",name:"scatterternary",basePlotModule:t("../../plots/ternary"),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/ternary":322,"../scatter/marker_colorbar":465,"../scatter/select":469,"../scatter/style":471,"./attributes":475,"./calc":476,"./defaults":477,"./event_data":478,"./format_labels":479,"./hover":480,"./plot":482}],482:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var a=e.plotContainer;a.select(".scatterlayer").selectAll("*").remove();var i={xaxis:e.xaxis,yaxis:e.yaxis,plot:a,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},o=e.layers.frontplot.select("g.scatterlayer");n(t,i,r,o)}},{"../scatter/plot":468}],483:[function(t,e,r){"use strict";var n=t("../box/attributes"),a=t("../../lib/extend").extendFlat;e.exports={y:n.y,x:n.x,x0:n.x0,y0:n.y0,name:a({},n.name,{}),orientation:a({},n.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,points:a({},n.boxpoints,{}),jitter:a({},n.jitter,{}),pointpos:a({},n.pointpos,{}),width:a({},n.width,{}),marker:n.marker,text:n.text,hovertext:n.hovertext,hovertemplate:n.hovertemplate,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"}}},{"../../lib/extend":227,"../box/attributes":353}],484:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../box/calc"),o=t("./helpers"),l=t("../../constants/numerical").BADNUM;function s(t,e,r){var a=e.max-e.min;if(!a)return t.bandwidth?t.bandwidth:0;if(t.bandwidth)return Math.max(t.bandwidth,a/1e4);var i=r.length,o=n.stdev(r,i-1,e.mean);return Math.max(function(t,e,r){return 1.059*Math.min(e,r/1.349)*Math.pow(t,-.2)}(i,o,e.q3-e.q1),a/100)}function c(t,e,r,n){var i,o=t.spanmode,s=t.span||[],c=[e.min,e.max],u=[e.min-2*n,e.max+2*n];function f(n){var a=s[n],i="multicategory"===r.type?r.r2c(a):r.d2c(a,0,t[e.valLetter+"calendar"]);return i===l?u[n]:i}var d={type:"linear",range:i="soft"===o?u:"hard"===o?c:[f(0),f(1)]};return a.setConvert(d),d.cleanRange(),i}e.exports=function(t,e){var r=i(t,e);if(r[0].t.empty)return r;for(var l=t._fullLayout,u=a.getFromId(t,e["h"===e.orientation?"xaxis":"yaxis"]),f=1/0,d=-1/0,p=0,h=0,g=0;g<r.length;g++){var v=r[g],m=v.pts.map(o.extractVal),y=v.bandwidth=s(e,v,m),x=v.span=c(e,v,u,y);if(v.min===v.max&&0===y)x=v.span=[v.min,v.max],v.density=[{v:1,t:x[0]}],v.bandwidth=y,p=Math.max(p,1);else{var b=x[1]-x[0],_=Math.ceil(b/(y/3)),w=b/_;if(!isFinite(w)||!isFinite(_))return n.error("Something went wrong with computing the violin span"),r[0].t.empty=!0,r;var T=o.makeKDE(v,e,m);v.density=new Array(_);for(var k=0,M=x[0];M<x[1]+w/2;k++,M+=w){var A=T(M);v.density[k]={v:A,t:M},p=Math.max(p,A)}}h=Math.max(h,m.length),f=Math.min(f,x[0]),d=Math.max(d,x[1])}var L=a.findExtremes(u,[f,d],{padded:!0});if(e._extremes[u._id]=L,e.width)r[0].t.maxKDE=p;else{var S=l._violinScaleGroupStats,C=e.scalegroup,O=S[C];O?(O.maxKDE=Math.max(O.maxKDE,p),O.maxCount=Math.max(O.maxCount,h)):S[C]={maxKDE:p,maxCount:h}}return r[0].t.labels.kde=n._(t,"kde:"),r}},{"../../constants/numerical":212,"../../lib":233,"../../plots/cartesian/axes":279,"../box/calc":354,"./helpers":487}],485:[function(t,e,r){"use strict";var n=t("../box/cross_trace_calc").setPositionOffset,a=["v","h"];e.exports=function(t,e){for(var r=t.calcdata,i=e.xaxis,o=e.yaxis,l=0;l<a.length;l++){for(var s=a[l],c="h"===s?o:i,u=[],f=0;f<r.length;f++){var d=r[f],p=d[0].t,h=d[0].trace;!0!==h.visible||"violin"!==h.type||p.empty||h.orientation!==s||h.xaxis!==i._id||h.yaxis!==o._id||u.push(f)}n("violin",t,u,c)}}},{"../box/cross_trace_calc":355}],486:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),i=t("../box/defaults"),o=t("./attributes");e.exports=function(t,e,r,l){function s(r,a){return n.coerce(t,e,o,r,a)}function c(r,a){return n.coerce2(t,e,o,r,a)}if(i.handleSampleDefaults(t,e,s,l),!1!==e.visible){s("bandwidth"),s("side"),s("width")||(s("scalegroup",e.name),s("scalemode"));var u,f=s("span");Array.isArray(f)&&(u="manual"),s("spanmode",u);var d=s("line.color",(t.marker||{}).color||r),p=s("line.width"),h=s("fillcolor",a.addOpacity(e.line.color,.5));i.handlePointsDefaults(t,e,s,{prefix:""});var g=c("box.width"),v=c("box.fillcolor",h),m=c("box.line.color",d),y=c("box.line.width",p);s("box.visible",Boolean(g||v||m||y))||(e.box={visible:!1});var x=c("meanline.color",d),b=c("meanline.width",p);s("meanline.visible",Boolean(x||b))||(e.meanline={visible:!1})}}},{"../../components/color":105,"../../lib":233,"../box/defaults":356,"./attributes":483}],487:[function(t,e,r){"use strict";var n=t("../../lib"),a=function(t){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*t*t)};r.makeKDE=function(t,e,r){var n=r.length,i=a,o=t.bandwidth,l=1/(n*o);return function(t){for(var e=0,a=0;a<n;a++)e+=i((t-r[a])/o);return l*e}},r.getPositionOnKdePath=function(t,e,r){var a,i;"h"===e.orientation?(a="y",i="x"):(a="x",i="y");var o=n.findPointOnPath(t.path,r,i,{pathLength:t.pathLength}),l=t.posCenterPx,s=o[a];return[s,"both"===e.side?2*l-s:l]},r.getKdeValue=function(t,e,n){var a=t.pts.map(r.extractVal);return r.makeKDE(t,e,a)(n)/t.posDensityScale},r.extractVal=function(t){return t.v}},{"../../lib":233}],488:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../box/hover"),o=t("./helpers");e.exports=function(t,e,r,l,s){var c,u,f=t.cd,d=f[0].trace,p=d.hoveron,h=-1!==p.indexOf("violins"),g=-1!==p.indexOf("kde"),v=[];if(h||g){var m=i.hoverOnBoxes(t,e,r,l);if(g&&m.length>0){var y,x,b,_,w,T=t.xa,k=t.ya;"h"===d.orientation?(w=e,y="y",b=k,x="x",_=T):(w=r,y="x",b=T,x="y",_=k);var M=f[t.index];if(w>=M.span[0]&&w<=M.span[1]){var A=n.extendFlat({},t),L=_.c2p(w,!0),S=o.getKdeValue(M,d,w),C=o.getPositionOnKdePath(M,d,L),O=b._offset,D=b._length;A[y+"0"]=C[0],A[y+"1"]=C[1],A[x+"0"]=A[x+"1"]=L,A[x+"Label"]=x+": "+a.hoverLabelText(_,w)+", "+f[0].t.labels.kde+" "+S.toFixed(3),A.spikeDistance=m[0].spikeDistance;var z=y+"Spike";A[z]=m[0][z],m[0].spikeDistance=void 0,m[0][z]=void 0,A.hovertemplate=!1,v.push(A),(u={stroke:t.color})[y+"1"]=n.constrain(O+C[0],O,O+D),u[y+"2"]=n.constrain(O+C[1],O,O+D),u[x+"1"]=u[x+"2"]=_._offset+L}}h&&(v=v.concat(m))}-1!==p.indexOf("points")&&(c=i.hoverOnPoints(t,e,r));var P=s.selectAll(".violinline-"+d.uid).data(u?[0]:[]);return P.enter().append("line").classed("violinline-"+d.uid,!0).attr("stroke-width",1.5),P.exit().remove(),P.attr(u),"closest"===l?c?[c]:v:c?(v.push(c),v):v}},{"../../lib":233,"../../plots/cartesian/axes":279,"../box/hover":358,"./helpers":487}],489:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("../box/defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":292,"../box/defaults":356,"../box/select":363,"../scatter/style":471,"./attributes":483,"./calc":484,"./cross_trace_calc":485,"./defaults":486,"./hover":488,"./layout_attributes":490,"./layout_defaults":491,"./plot":492,"./style":493}],490:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),a=t("../../lib").extendFlat;e.exports={violinmode:a({},n.boxmode,{}),violingap:a({},n.boxgap,{}),violingroupgap:a({},n.boxgroupgap,{})}},{"../../lib":233,"../box/layout_attributes":360}],491:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes"),i=t("../box/layout_defaults");e.exports=function(t,e,r){i._supply(t,e,r,(function(r,i){return n.coerce(t,e,a,r,i)}),"violin")}},{"../../lib":233,"../box/layout_defaults":361,"./layout_attributes":490}],492:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../box/plot"),l=t("../scatter/line_points"),s=t("./helpers");e.exports=function(t,e,r,c){var u=t._fullLayout,f=e.xaxis,d=e.yaxis;function p(t){var e=l(t,{xaxis:f,yaxis:d,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return i.smoothopen(e[0],1)}a.makeTraceGroups(c,r,"trace violins").each((function(t){var r=n.select(this),i=t[0],l=i.t,c=i.trace;if(!0!==c.visible||l.empty)r.remove();else{var h=l.bPos,g=l.bdPos,v=e[l.valLetter+"axis"],m=e[l.posLetter+"axis"],y="both"===c.side,x=y||"positive"===c.side,b=y||"negative"===c.side,_=r.selectAll("path.violin").data(a.identity);_.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin"),_.exit().remove(),_.each((function(t){var e,r,a,i,o,s,f,d,_=n.select(this),w=t.density,T=w.length,k=m.c2l(t.pos+h,!0),M=m.l2p(k);if(c.width)e=l.maxKDE/g;else{var A=u._violinScaleGroupStats[c.scalegroup];e="count"===c.scalemode?A.maxKDE/g*(A.maxCount/t.pts.length):A.maxKDE/g}if(x){for(f=new Array(T),o=0;o<T;o++)(d=f[o]={})[l.posLetter]=k+w[o].v/e,d[l.valLetter]=v.c2l(w[o].t,!0);r=p(f)}if(b){for(f=new Array(T),s=0,o=T-1;s<T;s++,o--)(d=f[s]={})[l.posLetter]=k-w[o].v/e,d[l.valLetter]=v.c2l(w[o].t,!0);a=p(f)}if(y)i=r+"L"+a.substr(1)+"Z";else{var L=[M,v.c2p(w[0].t)],S=[M,v.c2p(w[T-1].t)];"h"===c.orientation&&(L.reverse(),S.reverse()),i=x?"M"+L+"L"+r.substr(1)+"L"+S:"M"+S+"L"+a.substr(1)+"L"+L}_.attr("d",i),t.posCenterPx=M,t.posDensityScale=e*g,t.path=_.node(),t.pathLength=t.path.getTotalLength()/(y?2:1)}));var w,T,k,M=c.box,A=M.width,L=(M.line||{}).width;y?(w=g*A,T=0):x?(w=[0,g*A/2],T=L*{x:1,y:-1}[l.posLetter]):(w=[g*A/2,0],T=L*{x:-1,y:1}[l.posLetter]),o.plotBoxAndWhiskers(r,{pos:m,val:v},c,{bPos:h,bdPos:w,bPosPxOffset:T}),o.plotBoxMean(r,{pos:m,val:v},c,{bPos:h,bdPos:w,bPosPxOffset:T}),!c.box.visible&&c.meanline.visible&&(k=a.identity);var S=r.selectAll("path.meanline").data(k||[]);S.enter().append("path").attr("class","meanline").style("fill","none").style("vector-effect","non-scaling-stroke"),S.exit().remove(),S.each((function(t){var e=v.c2p(t.mean,!0),r=s.getPositionOnKdePath(t,c,e);n.select(this).attr("d","h"===c.orientation?"M"+e+","+r[0]+"V"+r[1]:"M"+r[0]+","+e+"H"+r[1])})),o.plotPoints(r,{x:f,y:d},c,l)}}))}},{"../../components/drawing":127,"../../lib":233,"../box/plot":362,"../scatter/line_points":461,"./helpers":487,d3:21}],493:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/color"),i=t("../scatter/style").stylePoints;e.exports=function(t){var e=n.select(t).selectAll("g.trace.violins");e.style("opacity",(function(t){return t[0].trace.opacity})),e.each((function(e){var r=e[0].trace,o=n.select(this),l=r.box||{},s=l.line||{},c=r.meanline||{},u=c.width;o.selectAll("path.violin").style("stroke-width",r.line.width+"px").call(a.stroke,r.line.color).call(a.fill,r.fillcolor),o.selectAll("path.box").style("stroke-width",s.width+"px").call(a.stroke,s.color).call(a.fill,l.fillcolor);var f={"stroke-width":u+"px","stroke-dasharray":2*u+"px,"+u+"px"};o.selectAll("path.mean").style(f).call(a.stroke,c.color),o.selectAll("path.meanline").style(f).call(a.stroke,c.color),i(o,r,t)}))}},{"../../components/color":105,"../scatter/style":471,d3:21}],494:[function(t,e,r){"use strict";r.version="1.58.4"},{}]},{},[11])(11)}));